Speed Up Object Detection

By JavaScriptSource Staff on Jan 11, 2006
Object detection is common in JavaScript. Browser irregularities mean that your code must sometimes contain branches for different browsers. Use this snippet to perform object detection once instead of every time you call addEvent.

The JavaScript Source: Snippets : Speed Up Object Detection

Simply click inside the window below, use your cursor to highlight the script, and copy [Control]+C the script into a new file in your text editor (such as Note Pad) and save [Control+S]. The script is yours!!!