recherche

Maison  >  Questions et réponses  >  le corps du texte

关于ajax跨域问题?

为什么本地电脑写的ajax请求同个文件夹的文件算跨域

在网上查到的解决方法是:给浏览器添加启动参数 --allow-file-access-from-files,经过测试有效,但不懂为什么???

phpcn_u233phpcn_u2332947 Il y a quelques jours1050

répondre à tous(2)je répondrai

  • 数据分析师

    数据分析师2017-09-30 23:58:41

    À propos des problèmes inter-domaines Ajax ? - Questions et réponses sur le site Web chinois PHP - À propos des problèmes inter-domaines ajax ? - Questions et réponses sur le site Web chinois PHP

    Veuillez regarder et apprendre.

    répondre
    0
  • 阿神

    阿神2017-01-24 11:14:02

    在使用ajax之前 你应该搭建一个服务器  要不然就会有问题  因为ajax请求的时候进行的是http://或者https://这种请求

    bVIxcN.png

    你这种文件目录的请求方式  ajax是不支持的

    看你的代码 应该是用sublime写的吧   改用webstrom或者hbulider 它会帮助你自动开一个服务器  或者  你也可以用Firefox打开。


    répondre
    0
  • Annulerrépondre