I recently encountered a problem with cross-origin access. I have studied it for a long time and found a lot of information on the Internet to find out what cross-origin access is, cross-origin means that the current page and the accessed page are not under the same domain name and are restricted by the same-origin policy of the browser. The same-origin means that the domain name, protocol, and port must be consistent; the same-origin policy means that scripts on the page cannot access resources of different sources (including HTTP responses and cookies). How can we achieve cross-origin access?
Jquery provides us with several methods:
Post: Cross-origin access is not allowed, and the browser does not;
Get: Cross-origin access is implemented. We found that it is normal in IE and 360 today, but it cannot return results in Google and FF. I don't know why;
GetJSON: Cross-origin access is supported. However, from the information found, This method requires defining a callback parameter on both the client and server;
Ajax: This method is the same as getJSON;
Jsonp: This method is the same as getJSON;