javascript - Intercept all calls to jQuery -
i intercept calls $
, jquery
functions. jquery()
, $()
, $.fn
etc etc otherwise need work unimpeded.
how can this?
it appear after.
(function(){ var oldjq = window.jquery; window.jquery = function(){ window.jquery.anthony.calls++; return oldjq.apply(null, arguments); }; window.jquery.anthony = { calls: 0 }; (var prop in oldjq) if (oldjq.hasownproperty(prop)) window.jquery[prop] = oldjq[prop]; window.jquery.prototype = oldjq.prototype; window.$ = window.jquery; })();
note not intercept functions called on jquery objects.
Comments
Post a Comment