TypeError:$(...).on不是函数 [英] TypeError: $(...).on is not a function

查看:142
本文介绍了TypeError:$(...).on不是函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 jQuery litebox .添加JS和CSS文件后,出现此错误TypeError:

I am using jQuery litebox. After adding JS and CSS files I got this error TypeError:

$(...).on is not a function at this line in js file                                           
 "return  $('body').on('click',       
'a[rel^=lightbox], area[rel^=lightbox]', function(e) {" 

有人可以帮我理解这里的问题吗?

Can anybody help me to understand the problem here?

我正在CakePHP 1.3中执行此实现.

I am doing this implementation in CakePHP 1.3.

推荐答案

问题可能出在您使用的是旧版jQuery.因为旧版的jQu​​ery具有实时"方法,而不是启用"

The problem may be if you are using older version of jQuery. Because older versions of jQuery have 'live' method instead of 'on'

这篇关于TypeError:$(...).on不是函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆