The following is my collection of time-saving tips for JavaScript programmers. This page lists various tasks and sample implementations, as well as corresponding tutorials and in-depth case studies.
Standards, most comprehensive tutorials and compatibility lists.
Related links:
- gecko DOM reference @ Mozilla developer center
- Event compatibility tables @ QuirksMode
IE does not support hasAttribute method
It just doesn't... it turns out that hasAttribute is a DOM Level 2 method, which IE is blissfully unaware of. The solution is to check the getAttribute for null value.
Related links:
- Attribute nightmare in IE - by Tobie Langel
- Here's a simulator solution
Toggling the visibility of an element
This can be done by changing either the display or the visibility property of an element.
Related links:
- Seven ways to toggle an element with JavaScript - Dustin Diaz from Google discusses various techniques
Faking Scrollbars with JavaScript
I am not sure if I would ever need to use this technique, but these examples look really nice, and they are cross-browser.
Related links: