Wednesday, February 23, 2011

if (window.focus) window.focus()

Object detection The whole point is that if you want to use the array document.images, first check if it is supported. If you want to use the focus method of the window, first check if it is supported.

If you always use object detection, your scripts will never generate any error messages, although they might not work in certain browsers.

No comments: