IE浏览器POST后不读GET成功 [英] IE not reading GET success after POST
问题描述
我有一个紧迫的问题,我似乎无法找出为什么IE不看我的帖子后获得成功。请人帮我尽快。我曾尝试缓存:假的。没有运气 。这适用于所有其他浏览器,只是没有IE
I am having an urgent issue, and I cannot seem to find out why IE does not read my success on get after the post. please someone help me asap. I have tried cache: false. no luck . This works in all other browsers, just not IE
$.ajaxSetup({ cache: false });
num = $('#num').val();
phone = $('#phone').val();
$.post("post.php?"+$("#MYFORM").serialize(), {
}, function(response){
if(response==1 && codeVal == 1 && telVal == 1)
{
$("#after_submit").html('');
$("#Send").after('<label class="success" id="after_submit">Η αποστολή πραγματοποιήθηκε</label>');
change_captcha();
clear_form();
$.ajax({
type:'get',
cache: false,
url: "http://web.somesite/submit_code.php",
dataType: 'html',
data:{ user: "one", pass: "mtwo", source: "WEB", receipt: num, msisdn: phone},
success: function(data) {
var qsFull = "http://web.somesite.gr/submit_code.php?" + data;
var qs = URI(qsFull).query(true);
TINY.box.show({html:qs.message,animate:false,boxid:'error',top:5});
}
});
}
else
{
$("#after_submit").html('');
$("#Send").after('<label class="error" id="after_submit">Error! in CAPTCHA .</label>');
}
});
OK,我想成功后添加一个错误,我看到,我让我的弹出,因为我是应该的,但qs.message的值为0。所以哼。为什么我会得到错误,而不是成功。当它是成功的在其他浏览器。
OK, i tried adding an error after the success and I see that I get my pop up as I should be, but the value of qs.message is 0. . so hmm. why would I get error and not success. when it is successful in other browsers.
推荐答案
我找到了答案,它是与IE浏览器不被灵活的交叉领域和这样的,所以我说像这样一个XDomainRequest
I found the answer, It has to do with IE not being flexible with cross domains and such, so I added a XDomainRequest like so
if (jQuery.browser.msie && window.XDomainRequest) {
var xdr = new XDomainRequest();
var my_request_data = { user: "M1web", pass: "m!", source: "WEB", receipt: num, msisdn: phone};
my_request_data = $.param(my_request_data);
if (xdr) {
xdr.onerror = function () {
alert('xdr onerror');
};
xdr.ontimeout = function () {
alert('xdr ontimeout');
};
xdr.onprogress = function () {
alert("XDR onprogress");
alert("Got: " + xdr.responseText);
};
xdr.onload = function() {
//alert('onload ' + xdr.responseText);
var qsFull = "http://web.web.gr/submit_code.php?" + xdr.responseText;
var qs = URI(qsFull).query(true);
TINY.box.show({html:qs.message,animate:false,boxid:'error',top:5});
callback(xdr.responseText);
};
xdr.timeout = 5000;
xdr.open("get", "http://web.web.gr/submit_code.php?" + my_request_data);
xdr.send();
} else {
}
}
这篇关于IE浏览器POST后不读GET成功的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!