JQM 1.4.5和splitview Uncaught Error:在初始化之前无法调用pagecontainer上的方法;试图调用方法'更改'

时间:2017-09-15 10:57:24

标签: jquery-mobile splitview

Jquery.mobile.splitview for jquery.mobile-1.4.5 error

"cannot call methods on pagecontainer prior to initialization; attempted to call method 'change'"

由于没有jquery.mobile.splitview升级,因此将JQM 1.2.1升级到JQM 1.4.5。

问题:JQM 1.4.5是否有jquery.mobile.splitview

Uncaught Error: cannot call methods on pagecontainer prior to initialization; attempted to call method 'change'
    at Function.error (http://localhost:3000/assets/jquery.self-bd7ddd393353a8d2480a622e80342adf488fb6006d667e8b42e4c0073393abee.js?body=1:254:9)
    at HTMLDivElement.<anonymous> (http://localhost:3000/assets/jquery.mobile-1.4.5.self-31d65ee183ce6d4c0e27b21fad8429156ee18d418063e7f9caf860b612092cc8.js?body=1:928:15)
    at Function.each (http://localhost:3000/assets/jquery.self-bd7ddd393353a8d2480a622e80342adf488fb6006d667e8b42e4c0073393abee.js?body=1:371:19)
    at jQuery.fn.init.each (http://localhost:3000/assets/jquery.self-bd7ddd393353a8d2480a622e80342adf488fb6006d667e8b42e4c0073393abee.js?body=1:138:17)
    at jQuery.fn.init.$.fn.(anonymous function) [as pagecontainer] (http://localhost:3000/assets/jquery.mobile-1.4.5.self-31d65ee183ce6d4c0e27b21fad8429156ee18d418063e7f9caf860b612092cc8.js?body=1:920:9)
    at Object.$.mobile.changePage (http://localhost:3000/assets/jquery.mobile-1.4.5.self-31d65ee183ce6d4c0e27b21fad8429156ee18d418063e7f9caf860b612092cc8.js?body=1:5845:26)
    at http://localhost:3000/assets/jquery.mobile.splitview.self-e15baccb65d7aa3afefe9b440484be73123530a8d491f74c462e7f9b27757ac8.js?body=1:34:20
    at HTMLDocument.<anonymous> (http://localhost:3000/assets/jquery.turbolinks.self-176b9819f30444d441e820bbccd3264fe57753aeafd54dec732b0dbc77129a2a.js?body=1:30:16)
    at HTMLDocument.dispatch (http://localhost:3000/assets/jquery.self-bd7ddd393353a8d2480a622e80342adf488fb6006d667e8b42e4c0073393abee.js?body=1:5227:27)
    at HTMLDocument.elemData.handle (http://localhost:3000/assets/jquery.self-bd7ddd393353a8d2480a622e80342adf488fb6006d667e8b42e4c0073393abee.js?body=1:4879:28)
jquery.self-bd7ddd393353a8d2480a622e80342adf488fb6006d667e8b42e4c0073393abee.js?body=1:254 Uncaught Error: cannot call methods on pagecontainer prior to initialization; attempted to call method 'change'
    at Function.error (http://localhost:3000/assets/jquery.self-bd7ddd393353a8d2480a622e80342adf488fb6006d667e8b42e4c0073393abee.js?body=1:254:9)
    at HTMLDivElement.<anonymous> (http://localhost:3000/assets/jquery.mobile-1.4.5.self-31d65ee183ce6d4c0e27b21fad8429156ee18d418063e7f9caf860b612092cc8.js?body=1:928:15)
    at Function.each (http://localhost:3000/assets/jquery.self-bd7ddd393353a8d2480a622e80342adf488fb6006d667e8b42e4c0073393abee.js?body=1:371:19)
    at jQuery.fn.init.each (http://localhost:3000/assets/jquery.self-bd7ddd393353a8d2480a622e80342adf488fb6006d667e8b42e4c0073393abee.js?body=1:138:17)
    at jQuery.fn.init.$.fn.(anonymous function) [as pagecontainer] (http://localhost:3000/assets/jquery.mobile-1.4.5.self-31d65ee183ce6d4c0e27b21fad8429156ee18d418063e7f9caf860b612092cc8.js?body=1:920:9)
    at Object.$.mobile.changePage (http://localhost:3000/assets/jquery.mobile-1.4.5.self-31d65ee183ce6d4c0e27b21fad8429156ee18d418063e7f9caf860b612092cc8.js?body=1:5845:26)
    at http://localhost:3000/assets/jquery.mobile.splitview.self-e15baccb65d7aa3afefe9b440484be73123530a8d491f74c462e7f9b27757ac8.js?body=1:34:20
    at HTMLDocument.<anonymous> (http://localhost:3000/assets/jquery.turbolinks.self-176b9819f30444d441e820bbccd3264fe57753aeafd54dec732b0dbc77129a2a.js?body=1:30:16)
    at HTMLDocument.dispatch (http://localhost:3000/assets/jquery.self-bd7ddd393353a8d2480a622e80342adf488fb6006d667e8b42e4c0073393abee.js?body=1:5227:27)
    at HTMLDocument.elemData.handle (http://localhost:3000/assets/jquery.self-bd7ddd393353a8d2480a622e80342adf488fb6006d667e8b42e4c0073393abee.js?body=1:4879:28)

但是在我更改// = require的顺序之后,在jquery.mobile.splitview之前加载了jquery.mobile-1.4.5,错误就消失了。

//= require jquery
//= require jquery.turbolinks
// require jquery_ujs
//= require jquery.mobile-1.4.5
//= require jquery.mobile.splitview
//= require jquery.mobile.datebox
//= require iscroll-wrapper
//= require iscroll
//= require turbolinks
//= require ckeditor/init
// require rails-ujs

新问题:屏幕未拆分为here但显示为no-split

在阅读其他问题之后,我怀疑{JQM-1.4.5中不推荐使用jquery.mobile.splitview.js中的$ .mobile.changePage函数

0 个答案:

没有答案