Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Mel Smith" Newsgroups: comp.lang.javascript Subject: Re: IE8 attachEvent problem Date: Sun, 20 Jan 2013 13:21:54 -0700 Lines: 54 Message-ID: References: X-Trace: individual.net fYIcHw5/GMgsgRRJ4VJ6AAVsQVYHezdxMHE5Ux+xQGyTW5htcQLazd9yAtIXHJWLkX Cancel-Lock: sha1:yGwxF+tNSAM/0q9GhyfIcyzKtAs= X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-RFC2646: Format=Flowed; Original Xref: csiph.com comp.lang.javascript:18168 Evertjan said: >> window.onload = "document.getElementById(tid).scrollIntoView();" > > If you change this to: > > body.onload = 'document.getElementById(tid).scrollIntoView();' > > ... shouldn't it work on most browsers, > "eventually" not needing any other "attaching"? > Hi Evertjan: I've changed my remember() function to what is show below, and re-tested: Result: On IE8, I get the error 'body is undefined' BUT, it works on IE8 and I return to the 'remembered' set of lines in the table even with the 'indefined' error ??? On Chrome, FF, ands Safari, I'm not sure what is going on ... -Mel -------------------------- function remember(e) { var targ,tid; if (!e) { var e=window.event; } if (e.target) { targ=e.target; } else if (e.srcElement) { targ=e.srcElement; } if (targ.nodeType==3) // defeat Safari bug { targ = targ.parentNode; } tid=targ.id; body.onload="document.getElementById(tid).scrollIntoView();" return; }