Jquery mobile 覆盖数据ajax=";假;来自jquerymobile中的父容器
我使用文档中提到的方法在父容器上设置Jquery mobile 覆盖数据ajax=";假;来自jquerymobile中的父容器,jquery-mobile,Jquery Mobile,我使用文档中提到的方法在父容器上设置data ajax=“false”,但我确实有一些情况希望通过ajax加载页面 有没有办法在父容器上设置默认值,但允许单个链接覆盖该设置?将data ajax=“true”添加到各个链接似乎不起作用。要设置全页加载的默认值: $(document).on("mobileinit", function(){ $.mobile.ajaxEnabled = false; }); 要设置单个数据,请使用ajax=true 不知何故,其他建议对我不起作用
data ajax=“false”
,但我确实有一些情况希望通过ajax加载页面
有没有办法在父容器上设置默认值,但允许单个链接覆盖该设置?将
data ajax=“true”
添加到各个链接似乎不起作用。要设置全页加载的默认值:
$(document).on("mobileinit", function(){
$.mobile.ajaxEnabled = false;
});
要设置单个数据,请使用ajax=true 不知何故,其他建议对我不起作用。但这一个确实有效。测试
<head>
<!-- ..... -->
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script>
$(document).on("mobileinit", function () {
// Reference: http://jquerymobile.com/demos/1.1.0/docs/api/globalconfig.html
$.extend($.mobile, {
linkBindingEnabled: false,
ajaxEnabled: false
});
});
</script>
<script src="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.js"></script>
<!-- ..... -->
</head>
<body>
<a href="holysmokewheredidtheajaxgo.html" data-ajax=true>Well, I'm still ajax. That's true!</a>
</body>
该脚本禁用jquery mobile页面中的所有ajax链接,那些应该是ajax链接的链接可以用作下面的a链接,数据为ajax=true
<head>
<!-- ..... -->
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script>
$(document).on("mobileinit", function () {
// Reference: http://jquerymobile.com/demos/1.1.0/docs/api/globalconfig.html
$.extend($.mobile, {
linkBindingEnabled: false,
ajaxEnabled: false
});
});
</script>
<script src="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.js"></script>
<!-- ..... -->
</head>
<body>
<a href="holysmokewheredidtheajaxgo.html" data-ajax=true>Well, I'm still ajax. That's true!</a>
</body>
$(文档).on(“mobileinit”,函数(){
//参考:http://jquerymobile.com/demos/1.1.0/docs/api/globalconfig.html
$.extend($.mobile{
linkBindingEnabled:false,
ajaxEnabled:错误
});
});