javascript - Why does form submission have no cross-domain problems, but ajax submission has cross-domain problems?
迷茫2017-05-16 13:33:57
0
3
537
To connect the company's intranet project, I need to call the interface of b.kkk.com from a.kkk.com, and use ajax to cross domain, but it can be submitted using a form.
Because the browser does not allow js to submit content across domains
Please download it from Baidu
浏览器同源策略
js does not allow cross-domain. You can try these two methods to deal with cross-domain
1. Proxy
2. JSONP
For this point, you can refer to the ajax related video on MOOC.com for a detailed introduction and processing method on this point.
What form? In an iframe?