Ajax not working when i read a local file

前端 未结 2 1982
暗喜
暗喜 2021-01-25 08:49

Okay i cannot solve this problem for 2 days straight.. This examlpe here: http://www.w3schools.com/ajax/tryit.asp?filename=tryajax_xml2 works just fine on the w3schools site. B

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-25 09:12

    You can't work with local files. The local file system is sandboxed so that, for example, you can't double click an HTML document in an email attachment, open it in your browser and have it upload your private files to the sender's server.

    If you want to test Ajax locally, then install a local webserver and test through it.

提交回复
热议问题