ncyoung.com

javascript namespaces

This entry is in the following categories:

Top->Programming->Web->JavaScript/DHTML
 - Older in JavaScript/DHTML: product selectors/search
 - Newer in JavaScript/DHTML: javascript programming links

You can hide all of the variables and functions you want to in a single javascript object. This is a good idea!!! If you use "i" as a variable name you are likely to conflict with other JS libraries in years to come!!! Crockford on private methods in JS. MS article on namespaces.

ALSO: You can add event listeners instead of assigning event handlers via attributes. It's friendlier because you don't nuke anyone else's events!! Here's the mozilla addEventListener docs.

BONUS: a lot of Mr. T vs Everything sites but not all of them



Dated: 06/01/2007