Click here to Skip to main content
15,919,893 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
XML
example
<pre lang="Javascript"><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>
<script type="text/javascript">
var auto_refresh = setInterval(
function () {
    $('#div').load('another.page');
}, 1000);
</script>


i dont want 'another.page' to load i just want to refreh the the '3div' div is it possible
if it is how

thank you
Posted
Updated 29-May-18 4:30am
Comments
Prasad Khandekar 2-Jul-13 3:09am    
Refresh with what? Div's don't have a auto refresh option as opposed to a html page which can do so via meta-refresh tag. The code snippet you have shared is actually using JQuery library to load some url contents into div.

Regards,
Sampath Kumar Sathiya 2-Jul-13 11:36am    
You need use load or ajax call auto refresh.

1 solution

add div id instead of another page url

JavaScript
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>
<script type="text/javascript">
var auto_refresh = setInterval(
function () {
    $('#div').load('#div');
}, 1000);
</script>
 
Share this answer
 
Comments
Richard Deeming 31-May-18 14:36pm    
Five years too late, and with code that won't work.

Stick to answering recent questions.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900