Skip to content

Instantly share code, notes, and snippets.

@lgsunnyvale
Created January 18, 2013 08:51
Show Gist options
  • Save lgsunnyvale/4563244 to your computer and use it in GitHub Desktop.
Save lgsunnyvale/4563244 to your computer and use it in GitHub Desktop.
mockjax
$.mockjax({
url: "/restful/fortune",
responseTime: 750,
contentType: "text/json",
responseText: [{
a:'a'
},{
a:'b'
},{
a:'c'
}]
});
var membership = Backbone.Model.extend();
var memberships = Backbone.Collection.extend({
model: membership
});
var col1 = new memberships();
col1.fetch({
url : "/restful/fortune",
success: function () {
console.log(col1);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment