I have a few questions...

I program in a modular enviroment.  I develop modules that can be
place on a by our users.  It's possible for a user to place a module
on a page twice, there by causing the jQuery for that particular
module to be run twice.  This generally causes clicks that toggle
things to be run twice really fast (if two modules are on the page),
thus it looks like nothing is happening.

I fixed this by adding an unbind("click") just before the .click in my
jQuery.  I'm guessing this is the only way to do this since I can't
really seem to find a way to access any other information about this
instance of the module on the page when my javascript is in a seperate
document.

I thought I'd be able to write some sort of if statement to keep the
jQuery bit from loading twice if the module was on the page twice, but
I've been unsuccessful.  Does anyone have any clues?

---
Secondly... after reading this

http://www.learningjquery.com/2006/12/quick-tip-optimizing-dom-traversal

I'm curious as to the best way to use selectors in my jQuery...

Would it be faster to do:

$("div.DataCollector_AccountDataManager table.addRollover > tbody >
tr").hover(...);

or

$("div.DataCollector_AccountDataManager table.addRollover
tr").hover(...);

Thanks for any tips on keeping jQuery binds from happening twice and
for any tips on optimizing jQuery speed.

Reply via email to