开发者

JQuery timer : is it advisable to use it?

JQuery timer : is it advisable to use it? or is it better to use Javascript native timer?

开发者_JAVA技巧

Jquery timer example


That plugin uses setInterval - I take it that's what you're referring to when you say "Javascript native timer" - and adds a bit of extra functionality on top. If you're already using jQuery, and you find yourself doing a lot of time-based stuff, I'd say it's highly recommended.


If the rest of your code is jQuery rather than vanilla JS, use the jQuery timer.


jQuery timers can be used in the same line as jQuery selectors, etc. and can be passed the function to execute as a block instead of a string. I would use it unless I had absolutely no other use for jQuery in my application, in which case I couldn't justify having my users load the library.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜