Skip to content
Permalink
Browse files
Make jQuery work without warnings in strict mode, in Firefox.
  • Loading branch information
jeresig committed Aug 20, 2007
1 parent 887c007 commit 2b05e24993c48f3b9c2cb9857090dc4b218b8834
Showing 2 changed files with 5 additions and 2 deletions.
@@ -196,14 +196,14 @@ jQuery.event = {
event.preventDefault = function() {
// if preventDefault exists run it on the original event
if (originalEvent.preventDefault)
return originalEvent.preventDefault();
originalEvent.preventDefault();
// otherwise set the returnValue property of the original event to false (IE)
originalEvent.returnValue = false;
};
event.stopPropagation = function() {
// if stopPropagation exists run it on the original event
if (originalEvent.stopPropagation)
return originalEvent.stopPropagation();
originalEvent.stopPropagation();
// otherwise set the cancelBubble property of the original event to true (IE)
originalEvent.cancelBubble = true;
};
@@ -340,6 +340,9 @@ jQuery.fn.extend({
else
e[ val == "toggle" ? hidden ? "show" : "hide" : val ]( prop );
});

// For JS strict compliance
return true;
});
},

0 comments on commit 2b05e24

Please sign in to comment.