It doesn't only override anything defined in the prototype, it actually replaces it. The $.fn
property is a copy of the prototype for the jQuery object, so $.fn
is the actual prototype, i.e. $.fn === jQuery.prototype
.
You are correct that you can't isolate such a change to your own calls to the object, it would also affect any other code calling the object as long as your change was in effect.
However, as jQuery is strictly single threaded, you could change the prototype, use the object and then change the prototype back, and no other code could be affected. As long as you have code running without a break, there are no events handled.