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.

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(3)
给我你的怀抱

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.

左手右手慢动作

Better post the code

What form? In an iframe?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template