I\'m now a front-end developer, and I have a project which is fine to use BackboneJS, and the server-side is written by others. Is there anyone who can tell me how to override
Here's an example of a modified Backbone.js ajax call:
var Forecast = Backbone.Model.extend({
url: function() {
return "http://api.wunderground.com/api/7eaec3b21b154448/conditions/q/" + this.get( "zip" ) + ".json";
},
parse : function( data, xhr ) {
var observation = data.current_observation;
return {
id: observation.display_location.zip,
url: observation.icon_url,
state: observation.display_location.state_name,
zip: observation.display_location.zip,
city: observation.display_location.city,
temperature: observation.temp_f
};
}
});
From: Elijah Manor's Intro to Backbone.JS