0

I am new to backbone js and i wanted to call one external url and i want the which will fetch from the url output.

I have tried like the following

var MyApp.myModel = Backbone.Model.extend({
    url: 'http://senthil_c/DSCFrameWork/UVIndevSvc.svc/GetWeatherByZipcode/02111/json'
});

var MyApp.myView = Backbone.View.extend({
    initialize: function() {
        this.model.bind("change",this.render,this);
        this.model.fetch();
    },
    render: function() {
        alert('do awesome stuff here');
    }
});

I dont know how to call and i dont know this one is correct or not any one suggest me?

siva
  • 1
  • 3

1 Answers1

1
initialize: function() {
    this.model = new MyApp.myModel();
    this.model.fetch();
}
gam6itko
  • 15,128
  • 2
  • 19
  • 18
user10
  • 5,186
  • 8
  • 43
  • 64
  • the link will have the json value but i cant get it – siva Oct 11 '13 at 10:49
  • are you running your application on webserver? and server that hosting this json file and your server are same? browsers by default doesn't allow cross domain calls – Ravi Hamsa Oct 11 '13 at 11:57