Skip to content

Instantly share code, notes, and snippets.

@danielcremer
Created October 20, 2011 15:20
Show Gist options
  • Save danielcremer/1301410 to your computer and use it in GitHub Desktop.
Save danielcremer/1301410 to your computer and use it in GitHub Desktop.
mock jquery
function ajaxSuccess(execution) {
var original_ajax = $j.ajax
$j.ajax = function(options) {
var response = JSON.parse( ajaxFixtures[options.url] || '{}' );
options['success'].call(this, response)
};
execution.call(this);
console.log('pong');
$j.ajax = original_ajax;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment