Skip to content

Commit

Permalink
protect script when jQuery isn't present
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Jun 11, 2010
1 parent b810de8 commit 9286660
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
File renamed without changes.
6 changes: 5 additions & 1 deletion tracekit.js
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,10 @@ TraceKit.computeStackTrace = (function () {
* asynchronous jQuery functions.
*/
(function ($) {

// quit if jQuery isn't on the page
if (!$) return;

var _oldEventAdd = $.event.add;
$.event.add = function (elem, types, handler, data) {
var _handler;
Expand Down Expand Up @@ -1053,4 +1057,4 @@ TraceKit.computeStackTrace = (function () {
throw e;
}
};
}(jQuery));
}(window.jQuery));

0 comments on commit 9286660

Please sign in to comment.