Khanh TOVenkata Krishna提出了一个问题:Trying to load local JSON file to show data in a html page using JQuery,或许与您遇到的问题类似。
回答者Communityhequ给出了该问题的处理方式:
As the jQuery API says: "Load JSON-encoded data from the server using a GET HTTP request."
http://api.jquery.com/jQuery.getJSON/
So you cannot load a local file with that function. But as you browse the web then you will see that loading a file from filesystem is really difficult in javascript as the following thread says:
Local file access with javascript
希望本文对你有帮助,欢迎支持JavaScript中文网