Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #12094
| 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> (permalink) |
| From | Thomas 'PointedEars' Lahn <PointedEars@web.de> |
| Reply-To | Thomas 'PointedEars' Lahn <cljs@PointedEars.de> |
| 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 | <bq9ck7l21j5j0t5tfmiegdlevuopg8dfh9@4ax.com> |
| 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<fF_KW@LD@k=MdN::NBIic==]BZ:afN4Fo<]lROoRA<`=YMgDjhgBS6]dJ=QET;ADZm8W4\YJNLUFDj8T]K0?CDmniOZG;K0K\H=5@RDJW1O |
| X-Complaints-To | usenet-abuse@arcor.de |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.javascript:12094 |
Followups directed to: comp.lang.javascript
Show key headers only | View raw
Bootleg Bart wrote:
> 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_
> <area coords="159, 110, 234, 127"
RTFM. There are not supposed to be spaces in that attribute value. Some
parsers are more forgiving than others.
>
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.
<http://jibbering.com/faq/>
> 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, <cife6q$253$1$8300dec7@news.demon.co.uk> (2004)
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
setTimeout and onclick Bootleg Bart <jknmp@axcop.org> - 2012-02-23 05:55 -0600
Re: setTimeout and onclick Bootleg Bart <jknmp@axcop.org> - 2012-02-23 06:57 -0600
Re: setTimeout and onclick Bootleg Bart <jknmp@axcop.org> - 2012-02-23 07:42 -0600
Re: setTimeout and onclick Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-02-23 14:58 +0100
Re: setTimeout and onclick Bootleg Bart <jknmp@axcop.org> - 2012-02-23 08:48 -0600
Re: setTimeout and onclick Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-02-23 15:59 +0100
Re: setTimeout and onclick Bootleg Bart <jknmp@axcop.org> - 2012-02-23 08:51 -0600
Re: setTimeout and onclick Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-02-23 15:55 +0100
csiph-web