CORS error when accessing local JSON file using vanilla JS AJAX request?

后端 未结 2 1299
我在风中等你
我在风中等你 2020-12-11 19:11

I am trying to use a vanilla JS AJAX request to pull back a JSON string from a locally stored JSON file (specifically trying not to use JQuery) - the below code is based on

相关标签:
2条回答
  • 2020-12-11 19:25

    Basically as Felix, error msg, et al below say - simply can't run an AJAX request against a local file.

    Thanks.

    0 讨论(0)
  • 2020-12-11 19:46

    Try to run the application on local server like apache or wamp then you will not face any issue

    0 讨论(0)
提交回复
热议问题