Use $.fixture.xhr to create an object that looks like an xhr object.
The following example shows how the -restCreate fixture uses xhr to return a simulated xhr object:
"-restCreate" : function( settings, cbType ) { switch(cbType){ case "success": return [ {id: parseInt(Math.random()*1000)}, "success", $.fixture.xhr()]; case "complete": return [ $.fixture.xhr({ getResponseHeader: function() { return settings.url+"/"+parseInt(Math.random()*1000); } }), "success"]; } }
$.fixture.xhr(xhr) -> Object
{optional:Object}
properties that you want to overwrite
{Object}
an object that looks like a successful XHR object.
Use $.fixture.xhr to create an object that looks like an xhr object.
Example
The following example shows how the -restCreate fixture uses xhr to return a simulated xhr object: