简体   繁体   English

jQuery Mobile对话框在页面加载时,对话框不加载

[英]Jquery Mobile Dialog on page load, the dialog doesn't load

I'm trying to get jQuery dialog to appear after webpage loads so that the user can input some important data so that the homepage can load some data. 我试图让jQuery对话框在网页加载后出现,以便用户可以输入一些重要数据,以便首页可以加载一些数据。

$(document).ready(function(){
            $.mobile.changePage( "CrewPopupDialog.html", { role: "dialog" } );
            });

When the page is loaded nothing happens. 加载页面后,什么也不会发生。 I am using the exact syntax from the jQuery Mobile API page http://api.jquerymobile.com/dialog/ The dialog page is a separate html file but I didn't think that would cause an issue. 我使用的是jQuery Mobile API页面http://api.jquerymobile.com/dialog/中的确切语法,该对话框页面是一个单独的html文件,但我认为这不会引起问题。

Google Chrome console is returning this error: Uncaught TypeError: Cannot call method 'changePage' of undefined Google Chrome控制台返回此错误:Uncaught TypeError:无法调用未定义的方法“ changePage”

Make sure that you imports are in the right order. 确保导入顺序正确。 jQuery then UI and lastly jQuery Mobile. jQuery,然后是UI,最后是jQuery Mobile。 My dialog now loads correctly and with the proper formatting. 现在,我的对话框可以正确加载并具有正确的格式。

    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
    <script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM