I have a problem using jQuery with native JavaScript (NOT prototype.js). When using the following code, jQuery 1.9.1 with an error message:
You can avoid these problems by making your extensions to the native prototypes as non-enumerable:
Object.defineProperty(Object.prototype, 'myVeryGreatFunction',{
value : function() {},
enumerable : false
});
Object.defineProperty
documentation on MDN
As Jan Dvorak mentioned, this solution does not work for old browsers (IE8-).