Cross-origin request for local file

后端 未结 4 1908
无人及你
无人及你 2021-01-11 12:35

I need to open a local html file in the browser. The javascript works fine but ajax stops working and XMLHttpRequest gives a cross origin error. Is there a way to run ajax f

4条回答
  •  -上瘾入骨i
    2021-01-11 13:21

    For anyone who wants to know, I had to run a server in the app to serve the js files. Seems like it's not possible to do it without running a server. If anyone knows of another way, do tell.

提交回复
热议问题