使用jQuery 3.x运行时CKFinder错误


CKFinder error when running with jQuery 3.x

CKFinder 3.3(用于PHP)似乎与jQuery 3.0或3.1不兼容。每当我尝试用这些版本中的任何一个加载CKFinder时,我都会得到这两个错误,CKFinder无法加载:

[Error] TypeError: undefined is not an object (evaluating 'a.event.props.concat')
    (anonymous function) (jquery.mobile.js:4:5781)
    (anonymous function) (jquery.mobile.js:4:6334)
    (anonymous function) (jquery.mobile.js:3:115)
    global code (jquery.mobile.js:3:130)
[Error] TypeError: undefined is not an object (evaluating 't.event.special.swipe.start')
init — ckfinder.js:3373
(anonymous function) — ckfinder.js:14863:116
execCb — ckfinder.js:715
check — ckfinder.js:510
enable — ckfinder.js:589
init — ckfinder.js:482:172
(anonymous function) — ckfinder.js:648:99
    check (ckfinder.js:5:21940)
    enable (ckfinder.js:5:24481)
    init (ckfinder.js:5:20742)
    (anonymous function) (ckfinder.js:5:26286)

如果我恢复到jQuery 1.12.3(没有其他更改),它工作得很好。

其中一个错误发生在jQuery移动版中,所以它可能是一个问题,然而,这是最新版本(1.4.5),我没有发现任何关于jQuery移动版和jQuery 3之间不兼容的报告。我还尝试使用jQuery迁移插件,但没有帮助。

我可以通过告诉CKFinder使用jQuery 1.12来解决这个问题,而它嵌入的页面使用3.1,但是,必须加载两个jQuery副本显然是不理想的。

这里只是一个提示,正如票上回答的https://github.com/ckfinder/ckfinder/issues/299#issuecomment-239440766

最新的jQuery移动框架1.4.5于2014年10月31日发布。它是在jQuery 2.2之前,目前还不支持https://github.com/jquery/jquery-mobile/issues/8381。也是在jQuery 3之前。x版本:3.0 - 2016年6月9日发布;3.1 - 2016年7月7日发布

如文档所示:

jQuery Mobile 1.4。x支持1.8.3到1.11.1/2.1.1的jQuery核心版本。

所以,直到jQuery Mobile不兼容jQuery 3。