jQuery $.ajax not working with url params in IE
When i do the following:
$.ajax({
type: 'GET',
url: 'http://www.domain.tld/feed',
dataType: 'xml',
success: function(data) {
...
}
});
Everything´s fine in IE(8).
But when i change the url option to
http://w开发者_开发技巧ww.domain.tld/?feed=myfeed
IE does nothing. I think the ? is the problem, but how can i get this working in this lovely browser?
And if you use the data object does that work?
see here jquery ajax
data (Object, String)
Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below).
in your case
$.ajax({
type: 'GET',
url: 'http://www.domain.tld/',
dataType: 'xml',
data: "feed=myfeed",
success: function(data) {
...
}
});
Try this:
$.ajax({
type: 'GET',
url: 'http://www.domain.tld/feed',
dataType: 'xml',
data: "feed=myfeed",
success: function(data) {
// success handler...
}
});
When you do this for a url: http://www.domain.tld/?feed=myfeed
I believe you are saying request to the default page in the domain: http://www.domain.tld/
[EDIT]
Ajax IE Caching Issue
精彩评论