Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery does not attach click to all h1 tags in my debugger

Tags:

jquery

I have made a debugger for the websites i develop that i simply include at the bottom of the page. Now because i include it after the tag, it might cause some problems i know but so far i haven't seen any but this:

http://www.abitnerdy.se/tmp/debuggertest

click to open the debugger, and then click on for example the dbquery part. What i notice is that it sometimes not opens, and sometimes it does. Exactly like the application log. Can't quite understand why it is doing that. I have attached an alert to see what div is going to be shown, and then i came to the conclusion that the click didn't attach.

The problem somehow only seems to occur at the last 2 divs.

anyone any idea's where to look?

by the way, feel free to use the code if you think it is usefull for your own projects.

like image 809
half-a-nerd Avatar asked Jan 24 '26 12:01

half-a-nerd


1 Answers

Seems like the last 2 h1 (<h1 id="dbquery" class="debug">) has same ID attribute and inside your click function you have something like if(current != $(this).attr("id")) So If one of the last 2 h1 is open it will not allow the other one to open.

Edit: I quickly changed the last h1 to a different ID in Firebug and then it worked fine for me.. So change the ID of one of last 2 h1 and It should work fine.

like image 85
Selvakumar Arumugam Avatar answered Jan 26 '26 02:01

Selvakumar Arumugam