這是我的第一個問題。首先,對不起我的'不完美'英語...在IE7中返回Ajax時出錯
我正在開發一個AJAX的ASP.NET MVC應用程序。
我在查看下面的代碼:
<% using(Html.BeginForm(null, "Home", FormMethod.Post, new{id="formcpf"})){ %>
<p>
<input name="tipo" type="radio" value="GeraCPF" /> CPF
<input type="radio" name="tipo" value="GeraCNPJ" /> CNPJ
</p>
<p>
<input type="submit" id="sbmt" value="Gerar" /> <br /><br />
<span id="lblCPF" class="respostaBG"></span>
</p>
和下面的JavaScript調用Ajax請求:有時
$(document).ready(function() {
$("form#formcpf").submit(function(event) {
$(this).attr("action", $("input[@name='tipo']:checked").val());
event.preventDefault();
hijack(this, update_sessions, "html");
});
});
function hijack(form, callback, format) {
$.ajax({
url: form.action,
type: form.method,
dataType: format,
data: $(form).serialize(),
success: callback
});
}
function update_sessions(result) {
$("#lblCPF").html(result);
}
在Firefox和Chrome工作正常
,但在IE7將值返回到標籤中,有時不會。我必須不斷提交才能獲得回報。
任何人都可以幫忙嗎?
沒有人可以幫助IE7。它無法修復。 – bzlm 2010-04-04 21:12:43