开发者

JQuery setInterval doesn't start at all

开发者 https://www.devze.com 2023-02-04 07:41 出处:网络
I\'m trying to run a function every second but no matter what I have tried it never happens. I have even simplified t开发者_如何学编程he code to

I'm trying to run a function every second but no matter what I have tried it never happens. I have even simplified t开发者_如何学编程he code to

jQuery(function(){ setInterval(function() { alert('interval'); }, 300); })

but it just doesnt do anything. I'm not getting any errors and jquery is definitely installed properly


jquery is definitely installed properly

Are you trying to say that you have referenced the jquery file from the correct path, something like

<script src="padth to jquery.js" type="text/javascript"></script>


Thanks for the suggestion guys, the code was correct and jQuery was installed. For some reason restarting my webserver corrected the problem, no idea what happened there.

0

精彩评论

暂无评论...
验证码 换一张
取 消