jquery查看元素是否绑定事件的方法:1、以前版本可以使用【obj.data('event'); 】方法;2、JQuery1.8版本取消了【obj.data】方法,改为【$._data】方法。
本教程操作环境:windows7系统、jquery1.8版本,Dell G3电脑。
jquery查看元素是否绑定事件的方法:
On previous versions, you could call it like for other data :
obj.data('events');
In jQuery 1.8, this direct access was removed, so in recent versions you must call it like this :
$._data(obj[0],"events")
以前版本可以使用obj.data('event')
; JQuery1.8版本取消了obj.data方法,改为$._data
方法
注意:$._data(obj[0],"event")
中的obj[0],一定要加上数组[0]下标,否则会取不到数据
-------以下为举例
相关学习推荐:javascript视频教程
以上是jquery如何查看元素是否绑定事件的详细内容。更多信息请关注PHP中文网其他相关文章!