什么数据AJAX ="假"真的吗? [英] What does data-ajax="false" really do?

查看:168
本文介绍了什么数据AJAX ="假"真的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的网站的链接不工作,我得到了使用数据AJAX我的锚=假没有得到真正的解释的解决方案。有人可以帮我吗?

The links on my site don't work and I got an solution of using data-ajax="false" on my anchors without getting a true explanation. Can someone help me?

推荐答案

数据AJAX 是jQuery Mobile的一个特点。 JQM默认会尝试加载用于改善用户体验和转换通过AJAX页面。如果设置数据AJAX =假然后JQM会做一个正常的页面请求,而不是使用AJAX。这可以用来在形式以及链接

data-ajax is a feature of jQuery Mobile. JQM by default will try to load pages via ajax for improved user experience and transitions. If you set data-ajax='false' then JQM will do a normal page request instead of using ajax. This can be used on forms as well as links.

文档

这告诉做一个完整的页面重载的框架,以清除阿贾克斯散列的网址

This tells the framework to do a full page reload to clear out the Ajax hash in the URL

如果要禁用,而不是增加阿贾克斯所有链接,然后数据AJAX 来的一切,你可以做到这一点是这样的:

If you want to disable ajax on all of your links then instead of adding data-ajax to everything, you can do it like this:

$(document).bind("mobileinit", function () {
    $.mobile.ajaxEnabled = false;
});

这篇关于什么数据AJAX ="假"真的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆