Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1524
  • Last Modified:

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

0
Dada44
Asked:
Dada44
  • 2
  • 2
2 Solutions
 
Michel PlungjanIT 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
 
twocandlesCommented:
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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now