Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!nuzba.szn.dk!pnx.dk!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 10:59:08 -0700 Lines: 36 Message-ID: References: <50fc2fac$0$6566$9b4e6d93@newsspool4.arcor-online.net> X-Trace: individual.net RBMPozjxVGoqNnC8dwiEnArThuWOo5xnnR6UVqjohSOk0C5xNXi2aqDhWTAwvVOSYq Cancel-Lock: sha1:Cg9QlECEZ9VS6o7WIbD0aN3/90Q= 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; Response Xref: csiph.com comp.lang.javascript:18165 Martin said: > > With both event APIs (MSHTML/IE as well as the W3C DOM) you need to pass > in a function object that you want to be called, not call a function. So > you need > window.addEventListener("load" > function() { > document.getElementById(tid).scrollIntoView(); > }, > false > ); > respectively > window.attachEvent("onload", function() { > document.getElementById(tid).scrollIntoView(); }); > > On the other hand if your remember function is called onload then it > should suffice to simply call the scrollIntoView, as your current code > does anyway, only accidentally. > > So depending on when/where you execute the remember function, you might > not need to use addEventListener respectively attachEvent, you can simply > put your > document.getElementById(tid).scrollIntoView(); > in the remember function. > Hi Martin: I'll print and study your response. Thank you ! -Mel Smith