How to load json data with `localhost` using jquery getJson function? -
i have json file folder. sample this:
json file :
{ "name" : "testing" } in view file trying this:
jquery(document).ready(function($) { var model = backbone.model.extend({}); var view = backbone.view.extend({ model : model, initialize : function () { this.data = $.getjson("originatingbanks.json", function(data) { console.log(data); //data not @ loading. }).error(function(jqxhr, textstatus, error) { console.log("error: " + textstatus + ", " + error); }); } }); var originatingbank = new view; }); the json file sitting html file sibling. wrong goes here? 1 me?
update
while try open using localhost, getting error local server:

Comments
Post a Comment