Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8826901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T07:15:20+00:00 2026-06-14T07:15:20+00:00

Assume I have jQuery with several plugins loaded. I run some code like this:

  • 0

Assume I have jQuery with several plugins loaded.

I run some code like this:

$('someSelector').someMethod('someParam', 'someOtherParam');
$('someOtherSelector').someOtherMethod('anotherParam');
$('anotherSelector').anotherMethodWhichMayOrMayNotBeAPlugin();

I’d like to write a hook to jQuery in order to record a structure in which I will hold:

  • What selector was used
  • Which method was called
  • What arguments did it get

I know I can override both $() to catch selectors and I can add methods to jQuery (by writing plugins), but I’m not entirely sure how to get method’s name and parameters while avoiding breaking the existing functionality of jQuery and its plugins.

Performance is not very important for this one, so any dynamic way to do it is also fine.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T07:15:21+00:00Added an answer on June 14, 2026 at 7:15 am

    You could iterate over all the functions in $.fn and replace each one of them with your own function.

    That function, in turn, can log the selector of the jQuery object it’s called on and the arguments it received, then call the original function.

    Something like:

    $.each($.fn, function(key, func) {
        if ($.isFunction(func)) {
            $.fn[key] = function() {
                console.log("Method '" + key + "' was called");
                console.log("  on selector '" + this.selector + "'");
                console.log("  with arguments: " + arguments);
                return func.apply(this, arguments);
            };
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's assume that we have simple jQuery code like the following: var $document =
Lets assume I have several <span class='remove-type'> elements on a page. In jQuery document.ready
Let's assume that we have following jQuery plugins (each of them in separate files):
Assume I have <ul> <li>2</li> <li>3</li> <li>4</li> <li>5</li> </ul> I want jQuery code to
Assume you have the following code: function name() { $(this).css('background', 'red'); } $('selector1').click(name); $('selector2').click(function
Let's assume you have a table and the following Jquery code var rows =
Using this as a simplified example, assume I have a table that has some
Let's assume i have HTML markup like this: <body> <div id=content> <div id=sidebar> </div>
Assume you have a page in ASP.NET where it makes sense to use JavaScript/jQuery
How do I check if browser supports position:fixed using jQuery. I assume I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.