How to get a json file into a text variable in javascript -
i new using json file , wanna put file text variable in javascript run function not in object....
have been trying this.. nothing...
var jqxhr = $.getjson( "json/test.json", function() { console.log( "success" ); }) alert (getdepth(jqxhr));
what going want retrieve contents of json file within success callback -
var jqxhr = $.getjson( "json/test.json", function(jsondata) { console.log( jsondata ); })
note resulting variable (jsondata
) not in fact contain text - contains javascript object.
Comments
Post a Comment