Just wondering what would be the best way to handle shared variable(s) between different events... for example:
var ele = '#foo'; $(document).ready(function() { $(ele). // ... Do something with 'ele'... }); $(window).load(function () { $(ele). // ... Do something with 'ele'... }); To me, the above seems a little sloppy... Is there a good way to contain the variable "ele" within it's own (relevant) namespace? Maybe I should be learning/reading about classes (OOP) and jQuery? Am I thinking too hard about this? :D I would greatly appreciate tips and/or suggestions. Have a great day/night! Cheers, Micky