admin管理员组

文章数量:1415491

window.setInterval(function(){
   $('#Notify-Bar').html('a new notification');
}, 5000);

Did not work on IE, however works fine on other major web browsers (like Chrome, Firefox, Opera)...

window.setInterval(function(){
   $('#Notify-Bar').html('a new notification');
}, 5000);

Did not work on IE, however works fine on other major web browsers (like Chrome, Firefox, Opera)...

Share Improve this question edited Feb 21, 2012 at 14:15 laurent 91k83 gold badges310 silver badges442 bronze badges asked Jan 20, 2011 at 9:11 Muaz KhanMuaz Khan 7,2469 gold badges44 silver badges77 bronze badges 5
  • 2 Just a remark: window.setInterval is not a jquery function. – Darin Dimitrov Commented Jan 20, 2011 at 9:13
  • oh sorry.....I've a few months experience of jQuery...however it not work on IE version of web browsers.... – Muaz Khan Commented Jan 20, 2011 at 9:14
  • what versin of IE are you using? i've tested it in IE8 and it works as expected. – gion_13 Commented Jan 20, 2011 at 9:24
  • I'm using IE8 version of Windows 7.... – Muaz Khan Commented Jan 20, 2011 at 9:27
  • Just tested on IE8 Win7, it works! Does it reports some errors? – stecb Commented Jan 20, 2011 at 9:38
Add a ment  | 

1 Answer 1

Reset to default 4

You should use something like

setInterval("myFunc()",5000);

function myFunc()
{
    $('#Notify-Bar').html('a new notification');
}

本文标签: javascriptwindowsetInterval jQuery function does not work on IE8Stack Overflow