Question

Is there anything equivalent to jQuery's .on functionality, for chrome-level javascript? I want a Firefox addon to add events on a large number of elements in a document in chrome context. Looping and adding eventlisteners sounds slow and wouldn't update on change, and importing jQuery into chrome code sounds unsupported and bloated. I read through the .on function in the source, but I'm not quite sure how it works.

Was it helpful?

Solution

To have fine performance while processing events of huge amount of elements, you may addEventListeners to the top elements. Do not forget to use e.target in this case.

Just to answer the question. Thanks kirilloid.

OTHER TIPS

Use zepto!

Zepto.js supports $.on()

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top