First we will make a customize function called getRefresh() -
function getRefresh(){
$(”#auto”).load(”data.php”, ”, callback);
}
Here we have used load( url, [data], [callback] ) ajax api. This api load HTML output from a remote file (data.php) and inject it into the div (auto). Below we have created a callback function named callback() -
function callback(){
setTimeout(”getRefresh()”, 1000);
}
setTimeout() function is used to call getRefresh() after a specified number of milliseconds (1000). Now we can add some jQuery effect to realize that the div is refreshing automatically
function getRefresh(){
$(”#auto”).fadeIn(”slow”);
$(”#auto”).load(”data.php”, ”, callback);
}
function callback(){
$(”#auto”).fadeOut(”slow”);
setTimeout(”getRefresh();”, 1000);
}
And finally here is the complete code -
// for jQuery html
<html>
<head>
<script src=”http://code.jquery.com/jquery-latest.js”></script>
<script type=”text/javascript”>
function getRefresh() {
$(”#auto”).fadeIn(”slow”);
$(”#auto”).load(”data.php”, ”, callback);
}
function callback() {
$(”#auto”).fadeOut(”slow”);
setTimeout(”getRefresh();”, 1000);
}
$(document).ready(getRefresh);
</script>
</head>
<body>
<h1>Auto refresh div by jQuery </h1>
<div id=”auto”>
Random text goes here
</div>
</body>
</html>
// for php server scripting language
// data.php
mysql_connect(”localhost”, “root”, “”);
mysql_select_db(”dbname”);
$result = mysql_query(”select * from tblname”);
while ($row = mysql_fetch_object($result)) {
echo $row->username.’’;
}
mysql_free_result($result);
Tags: auto refresh by jquery, auto refresh div, freelancer, Jquery, jquery ajax, jquery expert, jquery freelancer, jquery programmer, php freelancer, php programmer, programmer, refresh div, web application developer, web developer

Boobbilky
November 2nd, 2009
Other variant is possible also
Free Wii
December 3rd, 2009
Cheers for the great post - I enjoyed reading it! I always enjoy browsing this blog.
Fred
January 20th, 2010
thank you, very interesting idea
Brant Arpin
May 5th, 2010
In fact your creative writing abilities has inspired me to start my own BlogEngine blog now. it’s about to domain name|Really the blogging is spreading its wings rapidly. Your write up is a fine example of it.
this is the end if you want it lyrics
May 10th, 2010
Hey this is a great story. I’m going to email this to my friends. I stumbled on this while googling for some free downloads, I’ll be sure to come back. thanks for sharing.
simple spell
May 18th, 2010
Interesting information, may I use a part of it in my website?
telephone lyrics lady gaga
May 20th, 2010
Thanks for a awesome post and interesting comments. I found this post while searching for some lyrics. Thanks for sharing this article.
vector art
May 24th, 2010
Hi, I am studying graphic arts and your website is helpfull for both rookies and advanced designers. I’ve bookmarked you!
tv pc satellite
May 31st, 2010
I’ve got to say, this is a great post and a great blog alltogether. wty1d8
justin bieber never say never lyrics
June 1st, 2010
Hey this is a great article. I’m going to email this to my friends. I stumbled on this while googling for some rock lyrics, I’ll be sure to visit regularly. thanks for sharing.
Karena Cubie
June 6th, 2010
Awesome post man. I was wondering from where do you get all this stuff!!
drake light up lyrics
June 9th, 2010
This is a great post, I stumbled across your post while looking for lyrics. Thanks for sharing, I’ll be sure to recommend this site to others.
saviours of alliance
June 10th, 2010
Usually I do not post on blogs, but I would like to say that this article really forced me to do so! Thanks, really nice article.
proactol for easy weight loss
July 8th, 2010
proactol for easy weight loss…
Proactol like a healthy way of making it easier to take charge of your easy weight loss and eating habits. …
Johnwv
July 10th, 2010
Do you have copy writer for so good articles? If so please give me contacts, because this really rocks!
vin number check
July 12th, 2010
I have met some really neat people through the comments, I certainly want to encourage more me to comment. Thanks for the tips!
parts tools
July 12th, 2010
Being a new blogger, I would like to tell you that you have given me much knowledge about it. Thanks for everything.
Mr.parts tools
phentermine 37.5mg tabs
July 13th, 2010
I have different point of view
women piss in pants
August 29th, 2010
Thank you for this article. Thats all I can say. You most definitely have made this blog into something speciel. You clearly know what you are doing, youve covered so many corners.kind regards
apply for student loans
August 30th, 2010
All too often when I click a search result I land on a blog that is no where near as nice as this. The content here is obviously a cut above the others. thank you so much for posting it. I will defninately be back for more.private student loans
Lucid Dreaming
August 30th, 2010
A lot of hardened Science People (Show me proof) appear too dismissive of such topics as Auras, dream predictions, ESP, out of body experiences, life after death, spirits/entities, predictions etc. Could it be that Science just not have the technology to effectively measure these phenomenons effectively YET! Like lots of other topics two hundred many years ago Science just did not have the ability to prove it hence the fact for a long time people lived thinking the world was flat or accepting that there was a 50% chance of dying in child birth or a higher rate of deaths of babies. Now medical technology can keep babies alive as early as 15 weeks premature! And pregnancy illnesses like pre eclamsia toxemia and other nasty illnesses can be detected and the life of a pregnant mother saved. So is it not logical than rather dismissive these paranormal topics as a load of rubbish and do not exist because we don’t have the tools - what about if they do exist it’s just that we do not have the correct analyzing tools yet that is suitable to measure such paranormal activity. It may exist like genetics, space, minerals etc but we don’t have the technology yet. What do you believe. Just because Science can’t prove it yet doesn’t mean it doe sn’t exist, it might mean we don’t have the technology yet. Any positive contributions to this question. WHAT DO YOU Believe. DOES SCIENCE HAVE THE TOOLS OR COULD IT BE SCIENCE DOES NOT HAVE THE EFFECTIVE TECHNOLOGY TO MEASURE PARANORMAL ISSUES YET?
Jesus Serrano
August 30th, 2010
I had a really good time reading your blog. Time just fly away. An idle afternoon, a cup of coffee and your blog, a great combination to spend my time. Thanks.
online education degree
August 31st, 2010
This is very good article, I am very interested in its topic and read them was a pleasure.online education degree
Backlinks
August 31st, 2010
This is a good blog. Keep up all the work. I too love blogging and expressing my opinions. Thanks
health Weight loss
August 31st, 2010
This couldn’t be said more pro. Having reading this post I was reminded of my old roommate! He constantly kept talking about this kind of stuff. I will forward this article to him. I’m very positive he will love it. Thank you once again for sharing this.new weight loss
ESPY Awards Voting
August 31st, 2010
Easily, the article is actually the best topic on this registry related issue. I fit in with your conclusions and will eagerly look forward to your next updates. Just saying thanks will not just be sufficient, for the fantasti c lucidity in your writing. I will instantly grab your rss feed to stay informed of any updates.
forum avatars
August 31st, 2010
Wow this definitely takes me back, are you on twitter?
Lingerie
September 1st, 2010
Yes you learn more while you share your knowledge with others. . . . . .