And I thought I knew Javascript!

I think I can safely say that any future JS problems I might have, can very well be solved by Daniel Hall.

I was trying to create a Google Chrome extension for something at work and I wanted to link out of the pop up using standard href tags. This did not work so I tried attaching event handlers which resulted in the click method being called at bind time rather than at the event.

link.addEventHandler("click", callbackfunction(args));

What I did not know was that by passing arguments to the call back function, I was inherently calling it rather than binding a reference of it to the event handler. This was explained to me by Daniel, who I should add, is a very capable system administrator. And now JS expert.

about author-img author

I have no idea what to write here :(

no comments

Leave me comment