Results 1 to 8 of 8
-
4th May 2011, 07:43 AM #1OPMember
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"); }
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
-
4th May 2011, 09:39 AM #2Member
iframe is fool proof. set iframe href to whatever you want (same url to reload) using javascript.
-
4th May 2011, 11:08 AM #3OPMember
i know, but i dont want iframe.. i need javas.
-
4th May 2011, 03:47 PM #4Respected 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>
-
4th May 2011, 04:18 PM #5OPMember
Sure, and works fine with other files, but i cant call random.php in that way, simple cant load
-
4th May 2011, 10:23 PM #6Respected Member
Try this:
PHP Code:function ajax_request() {
$.get('random.php', function(data) {
$('#placeholder').html(data);
});
}
-
4th May 2011, 10:27 PM #7Super 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
-
5th May 2011, 07:49 AM #8OPMember
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
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Auto refresh page code ?
By travelmate in forum Technical Help Desk SupportReplies: 9Last Post: 15th Jan 2012, 10:54 AM -
Looking for a content-locker until page is facebook-liked
By xexmodder in forum Webmaster DiscussionReplies: 2Last Post: 12th Dec 2011, 06:37 AM -
[Shared] Reload this Page [Selling] HostTex.com - cPanel,500MB Space,2GB BW Starting from$1.49
By TheMostCreative in forum ArchiveReplies: 0Last Post: 2nd Jul 2011, 07:15 AM -
Retrieving page content PHP
By EXOT!C_ in forum Technical Help Desk SupportReplies: 7Last Post: 7th Oct 2010, 05:19 PM -
Reload this Page This eBook Will Show You How I Make $200 a day,
By Danwer in forum Completed TransactionsReplies: 0Last Post: 29th Mar 2009, 02:00 PM
themaPoster - post to forums and...
Version 5.35 released. Open older version (or...