我附加了常规 jQuery 库,并在 (jquery.mobile-1.2.0.min.js) 之后附加了 jQuery 移动文件。
一旦我附加 jQuery mobile 并刷新页面,我就会看到加载屏幕。
我尝试通过以下方式禁用它:
$(document).on("mobileinit", function(){
$.mobile.ajaxEnabled=false;
$.mobile.loadingMessage = false;
});
以及尝试不同的初始化函数:
$(document).bind('pageinit'){
但两者都不起作用。我仍然只是收到加载消息或完全空白的屏幕。
我真正需要它的唯一功能是滑动事件。
提前致谢。
最佳答案
Mobileinit必须在引入jQM js文件之前使用,如下所示:
<head>
<title>jQM Complex Demo</title>
<meta name="viewport" content="width=device-width"/>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css" />
<script>
$(document).on("mobileinit", function(){
$.mobile.ajaxEnabled=false;
$.mobile.loadingMessage = false;
});
</script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
</head>
如果在脚本加载后执行它,它将不起作用。
关于jquery - 禁用 jQuery Mobile 加载消息和 AJAX,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14602919/