Permalink
Browse files

Merge pull request #1285 from braddunbar/ajax

Avoid throwing when $ is not defined.
  • Loading branch information...
jashkenas committed May 5, 2012
2 parents 22606f9 + 4dcf4bd commit 36dfdab567ea6799e8c7ff34a2e34ad81cee4340
Showing with 2 additions and 2 deletions.
  1. +2 −2 backbone.js
View
@@ -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) {

0 comments on commit 36dfdab

Please sign in to comment.