JRS: In article <12*************@corp.supernews.com>, dated Thu, 13 Apr
2006 09:56:00 remote, seen in news:comp.lang.javascript, Tony <tony23@ds
lextreme.WHATISTHIS.com> posted :
why not
if (document.getElementById('product')) {
// code here when the element exists
}
or, untested but for efficiency,
if ( T = document.getElementById('product') ) {
// code herein when the element exists, using T
}
or
if ( !(T = document.getElementById('product') ) ) { AbandonShip() }
// code hereon when the element exists, using T
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.