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

  • Home
  • SEARCH
  • 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 1060317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:18:34+00:00 2026-05-16T18:18:34+00:00

This is basically for a library I’m building. In this module I’ll attempt to

  • 0

This is basically for a library I’m building. In this module I’ll attempt to build a debug helper library to help me during debugging.

My problems here are that when FDL.D.ListEvents() is called a couple of awkward things happen:

1) If I include enough _logEvent() calls, the last few stop closing their groups at the console, which makes it completely unreadable.

2) It “decides” that it listed less events than it actually did.

When I use _logEvent() on, for instance, just the mouseevents, it lists them kind of “correctly”, or at least in the way I’d expect the function to work, revealing and counting around 20 events on the DOM (though the timespan is determined to be zero, which is kind of weird).

Apparently I’m too dangerous to post
images 🙁
Edit: ! Now I can!

Output image:

Working ListEvents()

When I call the function with the full listing of events,
I get this weird output format instead:

Broken listing

The following would be the standalone part of the lib (you can run it) that is supposed to do the magic

var FDL = FDL || {};

// FIREBUG DEBUG LIBRARY

FDL.D = (function()
{
    function _logEvents(eventName)
    {
        var _arr = $(":visible");
        var _count = 0;

        console.groupCollapsed(eventName);

        _arr.each(function(idx)
        {
            var _el = this;
            var _id = _el.id;

            if(!_id){
                _id = _el.tagName;
            }

            var _ev = eval("_el." + eventName);

            if(_ev){
                console.log("%o\n" + _ev + "\n\n",$(this));
                _count++;
            }
        });

        console.log(_count + " " + eventName + " events");
        console.groupEnd();

        return _count;
    }

    return {
        ListEvents : function ()
        {
            var _start = new Date().getTime();
            var _count = 0;

            console.group("Events");

                _count += _logEvents("onblur");
                _count += _logEvents("onchange");

                _count += _logEvents("onclick");
                _count += _logEvents("ondblclick");

                _count += _logEvents("onerror");
                _count += _logEvents("onfocus");

                _count += _logEvents("onkeydown");
                _count += _logEvents("onkeypress");
                _count += _logEvents("onkeyup");

                _count += _logEvents("onmousedown");
                _count += _logEvents("onmousemove");
                _count += _logEvents("onmouseout");
                _count += _logEvents("onmouseover");
                _count += _logEvents("onmouseup");

                _count += _logEvents("onresize");
                _count += _logEvents("onselect");
                _count += _logEvents("onunload");

                var _diff = new Date(new Date().getTime() - _start).getSeconds();

                console.groupCollapsed("details");
                    console.log(_count + " events bound");
                    console.log(_diff + "s runtime");
                console.groupEnd();

            console.groupEnd();
        }
    };
})();

I tried a few ideas but I couldn’t come up with the right solution to make these _logEvent() calls chain in the expected order. The problem basically being that .each() is called async and I suppose this is what breaks my code’s execution order.


Thanks for your input! <3 stackoverflow

EDIT: I changed the groupCollapsed() calls with group() calls and it has worked indeed. Now I face a different problem, how should I make it so it only displays once for each event name the bindings as long as the bound function is the same?

For instance if somewhere we had $(":input").click(function(){alert("Clicked!");});

I’d like _logEvents("onclick") to display the function and selector just once, but display how many times it was bound. For instance if we had 4 inputs, the output would be:

jQuery(:input) Len:1 function () {alert(“Clicked!”);}

  • 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-05-16T18:18:34+00:00Added an answer on May 16, 2026 at 6:18 pm

    The problem is not in your code, it’s in the groupCollapsed routine. Use the old ‘group’ routine for now and you’ll be fine. This bugreport looks a lot like your problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to to build a Felix bundle in Eclipse. This basically includes
So I have basically started documenting a class library I made, this is the
Hello I'll try my best to explain this. Basically, I am loading a library
This code basically translates characters based on position in one string to the character
This is basically a math problem, but very programing related: if I have 1
This is basically a duplicate of this question , but the accepted answer was
This is basically the same question as Click items in select box, and then
This is basically a 'best practices' question. Struts 1 forms have getters and setters
This is basically a rails 3 version of this question . Short of parsing
So basically this code: class A { }; class B { B (const B&

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.