setInterval not working in Firefox

Hi all,

Inside of $(document).ready(function () I have the code below.

This is working great in IE, it loads mypage.htm into mydiv every 9 seconds. If I change the contents of mypage.htm I can see it in mydiv after 9 seconds with IE, but not with Firefox. With Firefox I can see the reloading symbol on top of the tab every 9 seconds, but I don't see the page changed.

What am I doing wrong? Please help!!
Thanks a ton in advance!
var refreshit= setInterval(function()
{
     $('#mydiv').load("mypage.htm");
 
}, 9000);

Open in new window

Dada44Asked:
Who is Participating?
 
Michel PlungjanConnect With a Mentor IT ExpertCommented:
erm... That is not setInterval that is not working
It is the jQuery or whatever it is you are using that does not do what you expect. Perhaps a caching issue

try


var refreshit= setInterval(function()
{
     $('#mydiv').load("mypage.htm?"+Math.random());
 
}, 9000);

or

var refreshit= setInterval('$("#mydiv").load("mypage.htm")', 9000);
 


0
 
twocandlesConnect With a Mentor Commented:
It seems a cache problem. Try to reload your page adding a random number:

$('#mydiv').load("mypage.htm?rnd=" + Math.random() );

0
 
Michel PlungjanIT ExpertCommented:
Great minds think alike - just some people type faster ;)
0
 
twocandlesCommented:
yes :)
0
 
Dada44Author Commented:
50 points more for the faster one ;) Thanks guys!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.