Skip to content
Advertisement

Tag: event-handling

Which events are the most intensive?

Which events are the most resource intensive to have attached? Is a mouseover “worst” than a click? Are there any events that are known to be really harsh on the browser? I have my sights on IE7 mainly, as we are seeing performance issues there. We use event delegation where we can. Or, how can I profile events which are

Why is event.ctrlKey returning undef?

I am calling a JavaScript function when an option is selected in a select element like so: The function does something like this: According to the alert, e.ctrlKey is undefined – I thought this was supposed to return either true or false? What am I missing here? Answer As per the standard, the attribute ctrlKey is only available on MouseEvents

JavaScript add events cross-browser function implementation: use attachEvent/addEventListener vs inline events

In order to add events we could use this simple first solution: or this second solution (that adds inline events): These are both cross-browsers and can be used in this way: Since I have the feeling attachEvent/addEventListener are used more around in events handling implementations, I’m wondering: Are there any disadvantages/drawbacks against using the second solution that I might better

Advertisement