jquery.mobile 1.4.5未捕获TypeError:无法读取未定义的属性'concat'

mob*_*bie 47 jquery jquery-mobile

我创建了一个示例index.html文件,其中包含最新的jquery(3.1.0)和jquery mobile(1.4.5).

在加载页面上,错误控制台输出:

jquery.mobile-1.4.5.js:3337 Uncaught TypeError: Cannot read property 'concat' of undefined

在这条线上:

mouseEventProps = $.event.props.concat( mouseHookProps ),

当我尝试包含jquery-1.11.2时没有问题.谁能告诉我为什么?提前致谢.

Man*_*dan 70

查看此文档

jQuery mobile被锁定到某些版本的jQuery!你会找到一个文本

jQuery Mobile 1.3.0支持jQuery核心版本1.7.2 - 1.9.1,我们也在积极测试即将推出的2.0版本.我们将与他们的发布保持同步,让您充分利用新的优势.

UPDATE

jQuery mobile现在也适用于2.x版本,但版本3仍然返回上述错误.

  • 使用[jQuery Migrate插件](http://code.jquery.com/jquery-migrate-3.0.0.js)很好地解决了这个问题. (9认同)
  • @dsghi 我在我的网站上加载了 jquery-migrate-1.4.1.min.js,但它没有解决问题。错误仍然存​​在。我确保在 jquery-mobile JS 文件上方加载 jquery-migrate 文件。 (2认同)

T.T*_*dua 20

== ==解决方案

使用最新版本1.5 (仅适用于: code.jquery.com):

http://code.jquery.com/mobile/1.5.0-alpha.1/jquery.mobile-1.5.0-alpha.1.min.js
Run Code Online (Sandbox Code Playgroud)

(感谢PF4Public)