Timeline for Making Array in Jquery
Current License: CC BY-SA 3.0
4 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Oct 16, 2011 at 15:25 | comment | added | Esailija | It has nothing to do with namespacing but to make it instantly clear to a reader that a piece of code uses jQuery. Also, most of my code is in "class" declarations where it doesn't make any sense to have it in document ready handler. | |
| Oct 16, 2011 at 15:21 | comment | added | Šime Vidas |
For jQuery code inside the DOM-ready handler (which is where all jQuery code should be anyways), you can use this trick to get the $ name safely: jQuery( function ( $ ) { ... });. Read here under section "Aliasing the jQuery Namespace".
|
|
| Oct 16, 2011 at 15:15 | comment | added | Esailija | @Šime Vidas Yeah $ would do here as it's clear it's mapped to jQuery. I always use jQuery out of (good?) habit, since in the wild there are gazillion libraries using $ :P | |
| Oct 16, 2011 at 14:59 | history | answered | Esailija | CC BY-SA 3.0 |