Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!feeder.erje.net!news.internetdienste.de!noris.net!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="ISO-8859-1" Message-ID: <2263175.FRqVoOGUtd@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Thu, 23 Feb 2012 14:58 +0100 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 7Bit Subject: Re: setTimeout and onclick Newsgroups: comp.lang.javascript References: Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 45 NNTP-Posting-Date: 23 Feb 2012 14:58:01 CET NNTP-Posting-Host: 4547e10d.newsspool1.arcor-online.net X-Trace: DXC=Ld onclick works and changes the self location in IE and Chrome. A new > window is also opened with the href="javascript:v6" in IE and Chrome. > > FireFox - onclick changes the self.location but doesn't open a new > window.What am I doing wrong? Thanks. _Firefox_ > href="javascript:v6('securitydetails.htm','_blank','scrollbars=yes,resizable=yes,width=780,height=690,top=0,left=0')" Please read the FAQ on `javascript:' URIs. > onclick="setTimeout(window.location.href='360v6.htm', 500)" > shape="rect" /> This assigns '360v6.htm' to window.location.href, which causes navigation *before* setTimeout() is called (as the assignment is the expression that makes up the argument). If you are lucky, setTimeout() can be called; if not, a TypeError exception will be thrown because the object previously referred to by `setTimeout' has already been destructed because of navigation. In general, you are looking for window.setTimeout(function () { window.location = '360v6.htm'; }, 500); although that does not make much sense here. Why do you want to slow down the user? PointedEars -- Danny Goodman's books are out of date and teach practices that are positively harmful for cross-browser scripting. -- Richard Cornford, cljs, (2004)