Home  >  Q&A  >  body text

iphone - 关于ios访问后台资源的问题

我是做后台接口的, 是restful结构的 ,
如果通过jquery ajax访问资源算是跨域 , 需要cors ,
但是ios他们访问为什么可以直接访问, ios访问我这边的后台端口为什么不算跨域 ?

黄舟黄舟2766 days ago660

reply all(1)I'll reply

  • 怪我咯

    怪我咯2017-04-17 17:52:36

    1. A large part of the reason why browsers prohibit cross-domain is to prevent XSS attacks. If you turn on cross-domain prohibition in the browser, you can cross-domain. So it does not mean that ajax or jquery is not allowed, but that it is prohibited by the browser
    2. iOS applications cannot carry out XSS attacks, so there are no restrictions. 3. When you access HTML-structured web pages in Android or iOS webview, there should also be cross-domain restrictions.

    reply
    0
  • Cancelreply