search

Home  >  Q&A  >  body text

javascript - Why does form submission have no cross-domain problems, but ajax submission has cross-domain problems?

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.

迷茫迷茫2743 days ago541

reply all(3)I'll reply

  • 给我你的怀抱

    给我你的怀抱2017-05-16 13:35:57

    Because the browser does not allow js to submit content across domains
    Please download it from Baidu浏览器同源策略

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-16 13:35:57

    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.

    reply
    0
  • ringa_lee

    ringa_lee2017-05-16 13:35:57

    Better post the code

    What form? In an iframe?

    reply
    0
  • Cancelreply