I have a grid and there is a column which contains <a>
anchor tag with some additional information in <data-..>
tag and has a class name <class='myspeciallink'>
. And in my unobtrusive JS script I select all the elements with that class name and apply live('click')
. I need that to be live() because the grid gets generated in the runtime.
What happens inside the live('click')
handler? I use that additional data and add a <div>
to the page based on that data. Which in its turn used to generate jQuery UI dialog. It works great on my computer.
But! How could that work in real-world? Should I be bothered about possible performance implications? I feel that applying live() on more than a dozen elements instantaneously
would affect the performance. Especially with rather complicated handler like mine - it needs to get the data, parse the data, create a div, apply a dialog and etc.
Does that smell like a bad design? Could you suggest a different approach or my concerns are unfounded? Can I use some sort of a profiler tool to find the bottlenecks in my javascript?
UPD: Still nobody suggested any profiling tool. firebug and chrome dev tools are good, but maybe there is something even better?