These JavaScript snippets can be used in conjunction with other scripts to enhance their usefulness. These can save you a great deal of time. Many of these are generic and can be used in most scripts. General questions about JavaScript snippets here should be posted to The JavaScript Forum.
More on internet.com
Title: Backward-Forward
Contributor: Lee Underwood
Contributor URL: http://javascript.internet.com
Details: 0.60 KB * Uploaded October 24 2005
Description: Use this snippet to add backward and forward buttons to your Web page.
[ Get Source Code ]
Title: getElementById
Contributor: Ultimater
Contributor URL: http://ultimiacian.tripod.com/
Details: 0.94 KB * Uploaded August 10 2005
Description: The document.getElementById
method is very useful but isn't supported in early browsers. To define the method for use in those older browsers, just add this snippet to the beginning of your scripts.
[ Get Source Code ]
Title: getPosition
Contributor: Ultimater
Contributor URL: http://ultimiacian.tripod.com/
Details: 0.77 KB * Uploaded August 29 2005
Description: When a layer is inside another layer, it's style.left and style.top positions can both be '0' but the layer itself can be 500 pixels away from the actual margin. These functions will return the true offset.
[ Get Source Code ]
Title: Multiple onLoad
Contributor: Lee Underwood
Contributor URL: http://javascript.internet.com/
Details: 0.33 KB * Uploaded September 19 2005
Description: Use this snippet in an external file to call several functions using the onLoad event handler.
[ Get Source Code ]