0

Possible Duplicate:
jQuery .load method not firing on IE9

Hi I'm using a simple setInterval and Jquery's Load to get the current date and time :

$(document).ready(function () {
    setInterval(function () {
       $('#main h1').load('date.php');
         },100);
  });

Works fine on chrome but only load's once on ie9 and doesn't update with page refreshes .

Content of date.php :

Saturday 21st of January 2012 03:34:31 PM
Community
  • 1
  • 1
Infra Stank
  • 816
  • 2
  • 7
  • 17
  • Are you seriously trying to load this PHP fragment ever 100ms? Does it work on IE9 if you change the time to something like 5000 to make sure and give it enough time to load before the next one comes a long? Also, what is the contents of date.php? – jfriend00 Jan 21 '12 at 15:28
  • Changing the time made no difference , updated the question with the contents of date.php . – Infra Stank Jan 21 '12 at 15:35
  • 1
    Do you realize that you could do this entirely with javascript in your page and no involvement of the server at all? Or, get the initial time once from your server and then update it from then on with javascript? – jfriend00 Jan 21 '12 at 15:44
  • @jfriend00 Of course , I was just testing out load and some other things on my new VPS when I stumbled across this , and thought it would be useful to find out what's going on now rather than later . And it was . – Infra Stank Jan 21 '12 at 16:39

1 Answers1

3

try this:

$(document).ready(function () {
    setInterval(function () {
       $('#main h1').load('date.php?' + Math.random());
         },100);
  });
thecodeparadox
  • 86,271
  • 21
  • 138
  • 164