Activity Stream
48,167 MEMBERS
6812 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 8 of 8
  1.     
    #1
    Member

    Default Reload content without page refresh

    Hello,
    I need help with reloading some part of page, actualy i want to make reload some content (post) on my wordpress blog without reloading page.. simple users can click on refresh button and get new post ...

    Im make random.php file and im include in my page this file, so there is 6 random posts...
    <?php include 'random.php';?>
    So now i need reload this part on click without reloading all page, im try found solution on the google but cant find any good tutorial or example..

    This works
    Code: 
    <input type="button" onclick="ajax_request()" value="Reload" /> <div id="placeholder"><?php include 'random.php';?></div>

    Code: 
    function ajax_request() {   $('#placeholder').html('<p><img src="/images/loader.gif" width="220" height="19" /></p>');   $('#placeholder').load("random.php"); }
    But i cant reload 'random.php' in this way , any help pls ?
    AmN Reviewed by AmN on . Reload content without page refresh Hello, I need help with reloading some part of page, actualy i want to make reload some content (post) on my wordpress blog without reloading page.. simple users can click on refresh button and get new post ... Im make random.php file and im include in my page this file, so there is 6 random posts... <?php include 'random.php';?> So now i need reload this part on click without reloading all page, im try found solution on the google but cant find any good tutorial or example.. This Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    iframe is fool proof. set iframe href to whatever you want (same url to reload) using javascript.

  4.     
    #3
    Member
    i know, but i dont want iframe.. i need javas.

  5.     
    #4
    Respected Member
    Since that is not JS but Jquery did you have this as the first part above the called function.
    PHP Code: 
    <script src="http://ajax.googleapis.com/ajax/
    libs/jquery/1.3.0/jquery.min.js"
    ></script> 

  6.     
    #5
    Member
    Sure, and works fine with other files, but i cant call random.php in that way, simple cant load

  7.     
    #6
    Respected Member
    Try this:

    PHP Code: 
    function ajax_request() {
    $.
    get('random.php', function(data) {
    $(
    '#placeholder').html(data);
    });

    You don't need the "onclick" in the HTML by the way, jQuery has a .click() event that you can use on element ID's.

  8.     
    #7
    Super Member
    I'm impressed Loget, I haven't seen you create a post with code before... Have you been hiding this or have I just been completely oblivious

    So kiss me and smile for me, say that you'll wait for me <'3

  9.     
    #8
    Member
    Hello,
    Im copy all files from server and make site clon on localhost, on localhost this method works fine, but on server cant load again random.php files,
    So now im found where is problem, im disable permalinks in wordpress on server and bingo! works... but with permalinks cant load... interesting i will try now on google search what is exactly problem

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Auto refresh page code ?
    By travelmate in forum Technical Help Desk Support
    Replies: 9
    Last Post: 15th Jan 2012, 10:54 AM
  2. Looking for a content-locker until page is facebook-liked
    By xexmodder in forum Webmaster Discussion
    Replies: 2
    Last Post: 12th Dec 2011, 06:37 AM
  3. Replies: 0
    Last Post: 2nd Jul 2011, 07:15 AM
  4. Retrieving page content PHP
    By EXOT!C_ in forum Technical Help Desk Support
    Replies: 7
    Last Post: 7th Oct 2010, 05:19 PM
  5. Reload this Page This eBook Will Show You How I Make $200 a day,
    By Danwer in forum Completed Transactions
    Replies: 0
    Last Post: 29th Mar 2009, 02:00 PM

Tags for this Thread

BE SOCIAL