Created
January 18, 2013 08:51
-
-
Save lgsunnyvale/4563244 to your computer and use it in GitHub Desktop.
mockjax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.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