Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #31820

Re: Button/link click not going anywhere

Path csiph.com!2.us.feeder.erje.net!feeder.erje.net!1.eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!feeder5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Newsgroups comp.lang.javascript
Subject Re: Button/link click not going anywhere
Date Mon, 12 Dec 2016 20:37:18 +0100
Organization PointedEars Software (PES)
Lines 29
Message-ID <2568366.VdNmn5OnKV@PointedEars.de> (permalink)
References <01f1e8f6-21ff-4262-8748-ec52521d927f@googlegroups.com> <kibk7dd211kg.1fiouohm77r6p$.dlg@40tude.net> <o2m0sf$iqh$1@solani.org> <1cknps6ke4f5s$.hwe6hkxull0r.dlg@40tude.net>
Reply-To Thomas 'PointedEars' Lahn <cljs@PointedEars.de>
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding 8Bit
X-Trace solani.org 1481571439 9079 eJwFwYkBgDAIA8CVGiEBx6k8+4/gHU1QhYtyLjdw275wcBxYaY6uDctS1hmesBb8PLWR+f4KIhAc (12 Dec 2016 19:37:19 GMT)
X-Complaints-To abuse@news.solani.org
NNTP-Posting-Date Mon, 12 Dec 2016 19:37:19 +0000 (UTC)
User-Agent KNode/4.14.2
Face iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXTxa4RFk5dUWANED8PFEfy7+MGBiW+n3ZNF/QuAAACaElEQVQ4jVXUwVOcMBQG8Dc7Rc4PUntdWV2uxjDpGaGeozOp1woar4jd5t/v9wLstMwsA/ntlxdCAgUc1hjTc9/JCZfGoo3wG3HdmdAWrIJRHe7GM/TmpY5VFefuVcAkkPbLIaN8rmPmjloyZxgyR3GuJ4K0AGtJ2htz8o7yqikm759fldQXaMpbDzjKAG+8v+AugVTOPO5DOjLvGtUYQwh0CPjnVMyGd+8/GfUB5nLKJDD2aLDh5HYyMDJGDwQIo2ZmZcKbowNmAdB/AzyFhrmF2MHRb0QJJfaAnwGB6orZhoykLzJtGwF/xpYxI1dswomiUj3gTuAIqCn/4C7cULwGNBtwMTk3Y4LfKB5YUaOKBKYtpplm7u0vip8tU1NWWyI/7XdcSuIDoMt6rVHMWT0DbjHPGqDqZVSa6zleLcUTcIKLoMv3ueJluALtAo9B302zPPlrtiVScRdCjXvVh3e3JpYa/jjkuC9N+LrBMlz/eAN4eQijX2EdLo6c5tGGHwLyHFtXk89dDGHwCVhG9T0S/j55AhRZgkMCmUQXJ49TnS1wnQDvw0eAh9ICeMmEFbCnPMFzjAvsWoEWEFdYEx+S0MoUZ1gT1wId8+AF3Bl2OoEu906AUHx5VLw/gXYg/x84loOah/2UYNrgiwSwGO7RfUzVBbx/kgpckumGOi6QirtD6gkLTitbnxNol47S2jVc2vsN5kPqaAHT8uUdAJM4v/DanjYOwmUjWznGfwB7sGtAtor5BgofDuzaRj4kSQAqDakTsKORa3Q3xKi3gE1fhl71KRMqrdZ2AWNNg/YOhQyrVBnb+i+nEg4bsDA+egAAAABJRU5ErkJggg==
Cancel-Lock sha1:adArBWxK6NPbQayKSrxbO7NgTQ0=
X-User-ID eJwFwYEBwCAIA7CXFFtg54DS/09YwuPbb8DpoKhxMjfbUDgYrga97VaH9DLDLIZSK199qZtENGzNKpTyB0+8FdI=
X-NNTP-Posting-Host eJwFwQkBwDAIA0BLfKGdHArBv4TdwVOzTyQysNjkKCI408btd4mHhoifLlwZrukXljJS9PoBM0IRrw==
X-Face %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&.<b';Md8`dH6iqhT)6C^.Px|[=M@7=Ik[_w<%n1Up"LPQNu2m8|L!/3iby{-]A+#YE}Kl{Cw$\U!kD%K}\2jz"QQP6Uqr],./"?;=4v
Xref csiph.com comp.lang.javascript:31820

Show key headers only | View raw


JJ wrote:
^^
Please post using your real name here.

> On Mon, 12 Dec 2016 12:15:31 +0100, Christoph M. Becker wrote:
>> On 12.12.2016 at 06:17, JJ wrote:
>>> For a link, set the HREF attribute to `javascript:void(0)`.
>> See <http://pointedears.de/scripts/faq/cljs/#javascriptURI>, for why
>> that may not be the best advice.
> 
> True, but OP doesn't want the browser to leave the current page, so
> there's no need for fallback. `HREF="javascript:void(0)"` would guarantee
> it without changing the current URL, when the link's click handler
> encounters an unhandled exception.

You have not read the FAQ entry, have you?

If there is no fallback, then an “a[href]” element should not have been used 
in the first place.  Besides, the problem then is the unhandled exception.

What actually happens is that the location of the window does change in that 
case, too, which is another reason why it is a bad idea (unless you make 
tests).

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | <http://PointedEars.de/es-matrix>
<https://github.com/PointedEars> | <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | Please do not cc me./Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Button/link click not going anywhere bit-naughty@hotmail.com - 2016-12-11 09:20 -0800
  Re: Button/link click not going anywhere Silvio <silvio@internet.com> - 2016-12-11 20:33 +0100
  Re: Button/link click not going anywhere "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-12-12 00:08 +0100
  Re: Button/link click not going anywhere JJ <jj4public@vfemail.net> - 2016-12-12 12:17 +0700
    Re: Button/link click not going anywhere "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-12-12 12:15 +0100
      Re: Button/link click not going anywhere JJ <jj4public@vfemail.net> - 2016-12-12 22:36 +0700
        Re: Button/link click not going anywhere Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-12-12 20:37 +0100
    Re: Button/link click not going anywhere bit-naughty@hotmail.com - 2016-12-14 09:36 -0800
      Re: Button/link click not going anywhere "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-12-14 18:49 +0100
      Re: Button/link click not going anywhere JJ <jj4public@vfemail.net> - 2016-12-15 09:22 +0700

csiph-web