JQuery Mobile-有没有办法关闭整个页面的AJAX? [英] JQuery Mobile - is there a way to turn off AJAX for the whole page?

查看:94
本文介绍了JQuery Mobile-有没有办法关闭整个页面的AJAX?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将现有的ASP.NET网站转换为使用jQuery Mobile控件.我所做的第一件事是用新的母版页和移动控件替换Login.aspx.但是,现在登录发生后,在代码背后,有一个Response.Redirect到Default.aspx.发生这种情况时,就会发生JavaScript错误,并且整个页面都将转储并且无法加载.

I am converting an existing ASP.NET website to use jQuery Mobile controls. The first thing I did was replace the Login.aspx with the new Masterpage and mobile controls. However, now after the login occurs, in the code-behind, there is a Response.Redirect to Default.aspx. When that occurs, a javascript error occurs and the whole page dumps and fails to load.

我的假设是,尝试移动AJAX的jQuery mobile中的机制无法与MS.NET生成的脚本很好地配合使用.因此,我希望jQuery忽略重定向而不是AJAXify.

My assumption is that the mechnanism(s) in jQuery mobile that try to AJAX everything are not playing nicely with scripts that MS.NET is producing. So I want jQuery to ignore the redirect and not AJAXify it.

问题是,我看到的所有解决方案都与向锚标记添加代码有关,但是我是从后面重定向的,而不是使用锚标记.

The problem is, all the solutions I see have to do with adding code to the anchor tag, but I'm redirecting from behind, not using an anchor tag.

推荐答案

将属性data-ajax="false"添加到页面上的<form>标记中.这样,提交登录表单时,jQuery Mobile不会尝试使用AJAX更新页面.

Add the attribute data-ajax="false" to the <form> tag on the page. That way when the login form is submitted, jQuery Mobile won't try to update the page using AJAX.

这篇关于JQuery Mobile-有没有办法关闭整个页面的AJAX?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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