Inline javascript performance.
- by Geromey
I know it is better coding practice to avoid inline javascript like:
<img id="the_image" onclick="do_this(true);return false;"/>
I am thinking about switching this kind of stuff for bound jquery click events like:
$("#the_image").bind("click",function(){
do_this(true);
return false;
});
Will I lose any performance if I bind a ton of click events? I am not worried about the time it takes to initially bind the events, but the response times between clicking and it happening.
I bet if there is a difference, it is negligible, but I will have a ton of functions bound. I'm wondering if browsers treat the onclick attribute the same way as a bound event.
Thanks