jQuery Ajax request from local filesystem (Windows file:///)

前端 未结 3 1434

I\'m trying to do an ajax request to get the contents of \"http://localhost/\" running on Windows Wamp Server.

The script is running from something like

3条回答
  •  南笙
    南笙 (楼主)
    2020-11-27 07:06

    This probably won't work, as the browser will think this is a cross-domain request. You've accessed the file via a file:// URL, but are trying to retrieve data from http://localhost. Try accessing your original file from http://localhost as well, and it'll probably start to work.

提交回复
热议问题