jQuery 升级 - jquery.mobile 添加 类
jQuery upgrade - jquery.mobile adding classes
我们目前正在将 jQuery 版本从 1.10 升级到 3.3.1
因此,我们还必须安装 jquery.mobile v1.5.0(因为这是唯一与 v3 兼容的版本)
jquery.mobile 正在向我的页面添加 类 以及额外的 div 元素(例如 data-role="page"
)
有什么方法可以阻止 jquery.mobile 做 this/disabling 它。这些新 类
影响了我的页面布局
在 mobileinit
上禁用 jQM $.mobile.autoInitializePage
。
<head>
<!-- jQuery.js here -->
<script>
$(document).on("mobileinit", function () {
$.mobile.autoInitializePage = false;
});
</script>
<!-- jQuery Mobile.js here -->
</head>
要手动初始化框架,请使用$.mobile.initializePage();
。
我们目前正在将 jQuery 版本从 1.10 升级到 3.3.1
因此,我们还必须安装 jquery.mobile v1.5.0(因为这是唯一与 v3 兼容的版本)
jquery.mobile 正在向我的页面添加 类 以及额外的 div 元素(例如 data-role="page"
)
有什么方法可以阻止 jquery.mobile 做 this/disabling 它。这些新 类
影响了我的页面布局在 mobileinit
上禁用 jQM $.mobile.autoInitializePage
。
<head>
<!-- jQuery.js here -->
<script>
$(document).on("mobileinit", function () {
$.mobile.autoInitializePage = false;
});
</script>
<!-- jQuery Mobile.js here -->
</head>
要手动初始化框架,请使用$.mobile.initializePage();
。