Programmer algorithm practice must read, common Java API skills to share>>>
$.ajax({
type: "POST",
async: false,
contentType: "application/x-www-form-urlencoded;charset=UTF-8",
xhrFields: {
withCredentials: true
},
url:url,
data:data,
success:function (response) {
arr = response.Data.ListData;
},
error:function (XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.readyState);
alert(textStatus);
}
});
The
code is as above. I thought it was a problem with the code, but later, I found that IE8 does not support CORS
protocol, that is, access control allow origin: *
added by background config
the solution is as follows:
Add jQuery. Support. CORS = true before $. Ajax
Or, add in $. Ajax
crossDomain:true,
dataType:'jsonp',
jsonp:'callback',
Original text https://blog.csdn.net/slzll/article/details/73175971
Similar Posts:
- JQuery Ajax crossdomain cannot be used in IE [How to Solve]
- Provisional headers are shown
- Vue + Django Project-Browser cross-domain error: Access-Control-Allow-Origin
- XMLHttpRequest status=0 (All You Should Know)
- When parsing background JSON data with Ajax: unexpected token o in JSON at position 1
- [Solved] Unapp H5 Error: Access to XMLHttpRequest at ‘http://www.localtest.com/api/api/v1/job/getPositionList’…
- How to Solve Error: Preflight response is not successful
- [Solved] Uncaught SyntaxError: Unexpected end of JSON input at JSON.parse
- fatal:’origin’ does not appear to be a git repository fatal:Could not read from remote re…
- Ajax “SyntaxError: missing ; before statement” [How to Solve]