Javascript – Get a handle on event listening in JavaScript


Last week we released Omniture's analytics code onto a large volume of web sites after tinkering and testing for the last week or so.

On almost all of our site templates, it works just fine. In a few scattered, unpredictable situations, there is a crippling, browser-crashing experience that may turn away some users.

We're not able to see a relationship between the crashing templates at this time, and while there are many ways to troubleshoot, the one that's confuddling us is related to event listeners.

The sites crash when any anchor on these templates is clicked. There isn't any inline JS, and while we firebug'ed our way through the attributes of the HTML, we couldn't find a discernable loop or issue that would cause this. (while we troubleshoot, you can experience this for yourself here [warning! clicking any link in the page will cause your browser to crash!])

How do you determine if an object has a listener or not? How do you determine what will fire when event is triggered?

FYI, I'd love to set breakpoints, but
between Omnitures miserably obfuscated code and repeated browser
, I'd like to research more
thoroughly how I can approach this.

Best Solution

I did an "inspect element" on a link in that page with firebug, and in the DOM tab it says there is an onclick function (anonymous), and also some other function called "s_onclick_0".

I coaxed firebug placing a watch like


to alert me the onclick function that omniture (i guess) attaches to links:

function anonymous(e) {
  var s = s_c_il[0], b =, "onclick");
  s.lnk =;
  s.lnk = 0;
  if (b) {
     return this[b](e);
  return true;

Maybe in the same way you can see what it is really running after all that obfuscation.