What is AJAX cross-domain issue
Simply put, it is when the front-end calls the back-end service interface
If the service interface is not in the same domain, cross-domain problems will occur
Recommended: "ajax video tutorial"
AJAX cross-domain scenario
Separate front-end and service-oriented development model
The front-end and front-end development are independent, and the front-end needs to call a large number of back-end interfaces
As long as the back-end interfaces are not the same A domain will cause cross-domain problems
Cross-domain problems are very common, and it is also important to solve cross-domain problems
AJAX cross-domain reasons
Browser restrictions: Browser security verification restrictions
Cross-domain (any difference in protocol, domain name, and port will be considered cross-domain)
XHR (XMLHttpRequest) request
AJAX cross-domain problem solving ideas
Browser: The browser removes cross-domain verification, which has little actual value
XHR: Do not use XHR, use JSONP, There are many disadvantages and cannot meet the current development requirements
Cross-domain: The callee is modified to support cross-domain calls (specified parameters); the caller is modified to hide cross-domain (based on proxy)
The above is the detailed content of What is ajax cross domain. For more information, please follow other related articles on the PHP Chinese website!