Document.ready for the target page not getting invoked using
Document.ready for the target page not getting invoked using jquery mobile transistion
我正在使用jquery mobile 1.3.1开发一个iphone移动应用程序,虽然有一个从a到B的页面转换,但加载函数ie$(document).ready上的页面B不会被调用
而如果我使用window.location.href从A导航到B,则调用该函数时不会出现任何问题。
我必须为我的应用程序使用页面转换,任何关于如何解决此问题的建议都将不胜感激
$('#page_id').on('pageshow', function(event) {
//Your script logic
});
在jquery mobile中,不建议使用document.ready,因为它在执行时只加载页面div。(<div data-role="page" id="page_id">
)在这里我们可以使用page.on函数。
注意:即使我们使用的是最新版本的jquery-mobile,jquery-moobile也不能顺利地进行页面转换。暂时我们可以关闭它们(page-transition="none"
),直到jquery mobile下一版本发布。如果转换与正在执行的脚本一起正常工作,那么我不建议关闭它们。
查看jQuery Mobile常见问题解答:
http://view.jquerymobile.com/1.3.1/dist/demos/faq/dom-ready-not-working.html
相关文章:
- jQuery is not loaded
- AngularJS JSON not arriving php
- $rootScope not working
- reactRedux is not defined
- jQuery document.ready not working
- Javascript/Jquery Blob not showing Chrome PDF
- ReferenceError: not defined
- ReferenceError: cordova is not defined @ng-cordova.min.js:7
- Javascript getElementsByTagName not working?
- jQuery's trim()的前缀为not运算符
- Javascript - element.childNodes does not see an append.newch
- SemanticUI模态not onDeny/onApprove事件未激发
- WebkitTransform not fluent
- JQuery.val( ) not working
- Tomcat websocket is not working
- ngSubmit not getting submitted
- Document.ready for the target page not getting invoked using
- YDN-DB getting Store: null not exist
- IE9 NOT getting 'children' of XML node
- EaselJS not getting linked