jquery performance of binding multiple click events.
- by DA
I have a situation where I need to bind a click event to an object multiple times.
For instance:
for(i=0;i<=100;i++){
    $myObject.click(function(){
         window.location = "myurl"+i+".html";
    })
    ...do other stuff...
}
Via that markup, does $myObject end up with 100 click events attached to it? Should I be unbinding the click event first each time?
for(i=0;i<=100;i++){
    $myObject.unbind('click').click(function(){
         window.location = "myurl"+i+".html";
    })
    ...do other stuff...
}