Solution for access exceptions of cross-origin interfaces of IE8 Browser: domain interfaces of ie8 Browser
Browsers earlier than IE8 are absolutely magical. They have been busy for a long time and everything is ready. They are actually exploding when ajax calls an interface.
Describe the problem
First, there is such an interface: Request type POST, input parameter JSON, output parameter JSON. The jQuery ajax call code is as follows:
Chrome works perfectly, but when we port the same code to IE8, the IE console tells me this.
Okay, it's also a headache for cross-origin problems. Okay. Now, we still use jsonp to solve this problem. However, the interaction method of jsonp must be modified to modify the interface type. OK, change POST to GET, and change it to jsonp. The ajax call code is as follows:
The IE console tells me this again, oh
Obviously, the returned values in the interface are not received. After checking the information, it turns out that the cross-origin function needs to be used to encapsulate the returned results, that is, the returned json string is returned as a function callback, below is the string returned by our final Interface
Callback ({"status": "0", "message": "OK "})