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:

here screen shot


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

asp.net - Passing parameter to telerik popup -

node.js - ldapjs - write after end error -