jQuery测试对象是否具有方法? [英] jQuery test for whether an object has a method?
本文介绍了jQuery测试对象是否具有方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以测试jQuery对象是否具有特定方法?我一直在寻找,但到目前为止没有成功.谢谢!
Is it possible to test whether a jQuery object has a particular method? I've been looking, but so far without success. Thanks!
推荐答案
这应该有效:
if (!!$.prototype.functionName)
这篇关于jQuery测试对象是否具有方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文