473,320 Members | 2,027 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How do you use Firebug to examine an event listener

Claus Mygind
571 512MB
I am starting to use

".addEventListener("click",function(){alert('click ')},false);"

In the older method where the event handler was assigned in the html code like onClick = "...", it is easy in Firebug to right click on the element and examine the assignment.

With the addEventListener, I can examine the element and I can see the assignment in the DOM tab, but I cannot see the action assigned to the element.

I currently have a button I have assigned a listener to but the action does not execute. What is the best way to trace this down?

Here is the assignment code.

Expand|Select|Wrap|Line Numbers
  1.     this.makeTable = 
  2.         function (nodeId)
  3.         {
  4.             document.getElementById( nodeId ).innerHTML = 
  5.             '<form id="'+nodeId+'Form">'+
  6.             '    <table id="insideTable" class="insideTable" style="padding:0px; margin:0px;" width="100%"; height="100%";> '+
  7.             '        <tr><td id="titleBar"> '+
  8.             '            <button'+ 
  9.             '                type="button" id="'+nodeId+'Close" '+ 
  10.             '                style="padding:0px; float:right; background-color:blue,color:yellow;">'+
  11.             '                <img src="/exp/images/closeButton.gif" style="height:16px;width:16px;">'+
  12.             '            </button>'+
  13.             '        </td></tr><tr><td> '+
  14.             '            <table class="insideTable" id="aPadTable" name="aPadTable" align="center"> '+
  15.             '                <tbody id="'+nodeId+'Data" ></tbody>'+
  16.             '            </table>'+
  17.             '        </td></tr> '+
  18.             '    </table>'+
  19.             '</form>';
  20.  
  21.             //add onclick event handler to close button
  22.             var pButton = document.getElementById( nodeId+'Close' );
  23.  
  24.             if (pButton.addEventListener)
  25.             {
  26.             pButton.addEventListener("click",function(){g.nodeMgr.removeNode(nodeId)},false);
  27.             };
  28.         };
  29.  
It is suppose to run this code.
Expand|Select|Wrap|Line Numbers
  1.     this.removeNode =    
  2.         function (nodeId)
  3.         {
  4.             var elem = document.getElementById(nodeId);
  5.             elem.parentNode.removeChild(elem);
  6.         };
  7.  
  8.  
Could this possibly be a timing issue?

I have other buttons on my menu bar with similar assignment methods and they work fine.
Sep 7 '11 #1

✓ answered by Dormilich

With the addEventListener, I can examine the element and I can see the assignment in the DOM tab, but I cannot see the action assigned to the element.
install EventBug (available through the FireBug site), this will give you an additional Event tab which also lists the functions to execute.

4 2804
Dormilich
8,658 Expert Mod 8TB
With the addEventListener, I can examine the element and I can see the assignment in the DOM tab, but I cannot see the action assigned to the element.
install EventBug (available through the FireBug site), this will give you an additional Event tab which also lists the functions to execute.
Sep 7 '11 #2
Claus Mygind
571 512MB
@Dormilich
Is this the add on you are talking about?
Firebug Paint Events
Sep 7 '11 #3
Claus Mygind
571 512MB
Never mind, I found the correct file.

Thanks again for your wonderful advice.
Sep 7 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Neil Cherry | last post by:
I have to modifiy a program which uses a serial interface and event listeners. The modification entails adding support for connecting to a terminal server via an IP address and port number instead...
3
by: Csaba Gabor | last post by:
Is there a way to remove an anonymous event handler that I attached using attachEventListener? Or to say it another way, is there a way to remove all event handlers that have been attached to an...
6
by: Steve Teeples | last post by:
I have been perplexed by how to best treat an event that spans different classes. For example, I have a form which a user inputs data. I want to broadcast that data via an event to another...
6
by: Jeremy | last post by:
I want each instance of an object to be able to listen for input events. When the event occurs, a method of the object should be called, such that "this" is in scope and refers to the object...
6
by: Daz | last post by:
Hi, I am trying to find an event listener which will trigger when the pages starts loading, as opposed to when it's finished, or when the DOM content has finished loading. I am sure that such a...
6
by: Daz | last post by:
Hello everyone, I would like to open a child window from the parent, and add an onload event listener to the child window which will tell the parent when the document has loaded. As far as I...
0
daJunkCollector
by: daJunkCollector | last post by:
I wrote the following script. I have a movieclip named countyA_mc. I want the user to mouse over this movie clip, and result in the sending of a variable to the middle tier. I can establish...
1
Cristian Pinheiro
by: Cristian Pinheiro | last post by:
Hello guys, I was playing with Image Thumbnail Viewer (ITV) and found one problem, see http://www.dynamicdrive.com/dynamicindex4/thumbnail.htm for more details and how it works. Now the...
3
bugboy
by: bugboy | last post by:
i'm trying to avoid inline event handlers by creating a listener. What i'm trying is based on reading this: http://www.quirksmode.org/js/events_advanced.html I can't figure out what i'm doing...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.