Tuesday, 10 September 2013

jQuery error when extending object prototype

jQuery error when extending object prototype

If I extend the Object prototype and try to use some functions of jQuery
2.0.3 I get errors...
For example jsFiddle
Object.prototype.GetHashCode = function() { return 1; };
$(document).on("click", "div", function() { });
If I do this and then click any div I get an error
Uncaught TypeError: Object function () { return 1; } has no method 'exec'
Why does it happen? Is there a workaround or a way to fix this bug in jQuery?

No comments:

Post a Comment