JQuery Post request failing in IE 7
I'm doing a standard post using JQuery 1.4.4, not cross domain.
$.post("http://localhost:8085/ComponentPreferences:ignoreContent?_="+new Date().getTime(), {mydata:bla}, function(xml) {
//do something
});
This has suddenly stopped working on IE7 (works on all other browsers), the request is simply never sent (verified via Fiddler). It used to work fine on IE7 (as far as I am aware, nothing has changed :-) )
I've debugged the JQuery post method through to the ajax call and can see that it's getting as far as opening the socket (~ line 5912 on jQuery 1.4.4)
xhr.open(type, s.url, s.async);
The URL being passed in looks good, type is POST, async is true.
but this never returns开发者_StackOverflow中文版. No error is reported. I've got all the security settings on IE7 at the minimum.
Any clues how to debug this further or what the problem might be?
try this make sure server is getting request
$.ajax({
type: 'POST',
url: url_,
data: urlParams_,
dataType: 'text',
async: false,
success: function(result_) {
if (result_.length > 0 ){
try{
result_ = $.parseJSON(result_);
result = result_;
}catch (e){
alert(e);
}
}
}
});
Add
$.support.cors = true; $.mobile.allowCrossDomainPages = true;
for submitting ajax request to server
精彩评论