Loading local JSON file

前端 未结 23 1632
悲哀的现实
悲哀的现实 2020-11-22 01:28

I\'m trying to load a local JSON file but it won\'t work. Here is my JavaScript code (using jQuery):

var json = $.getJSON("test.json");
var data = e         


        
23条回答
  •  悲&欢浪女
    2020-11-22 01:46

    In angular (or any other framework), you can load using http get I use it something like this:

    this.http.get( console.log(data));
    

    Hope this helps.

提交回复
热议问题