如何确定网页是否启用了jquery? [英] How to determine if a web page is jquery-enabled?
本文介绍了如何确定网页是否启用了jquery?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
确定网页是否启用了jquery的最佳方法是什么?使用jquery本身,如果这是确定它的最佳方法。
What is the best way to determine if a webpage is jquery enabled? Using jquery itself if that's the best way to determine it.
推荐答案
if(jQuery) //jquery object exists
jQuery不是魔术 - 它本质上只是一个大对象。您可以像检查任何其他对象一样检查它。
jQuery isn't magic - it's essentially just a big object. You can check for it like you would any other object.
确保加载jQuery中的库同样如此:
Same thing to ensure libraries within jQuery are loaded:
if(jQuery.DatePicker) //lib exists
这篇关于如何确定网页是否启用了jquery?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文