Skip to content

Commit

Permalink
Merge pull request jashkenas#1285 from braddunbar/ajax
Browse files Browse the repository at this point in the history
Avoid throwing when $ is not defined.
  • Loading branch information
jashkenas committed May 5, 2012
2 parents 22606f9 + 4dcf4bd commit 36dfdab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backbone.js
Expand Up @@ -1370,8 +1370,8 @@
return Backbone.ajax(_.extend(params, options));
};

// Set the default ajax method.
Backbone.ajax = $.ajax;
// Set the default ajax method if $ is defined.
if ($) Backbone.ajax = $.ajax;

// Wrap an optional error callback with a fallback error event.
Backbone.wrapError = function(onError, originalModel, options) {
Expand Down

0 comments on commit 36dfdab

Please sign in to comment.