<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Mind that that prevents default browser behavior.<div class=""><br class=""></div><div class="">You can prevent a link from getting keyboard focus by setting a negative tabIndex property:&nbsp;<a href="https://html.spec.whatwg.org/multipage/interaction.html#dom-tabindex" class="">https://html.spec.whatwg.org/multipage/interaction.html#dom-tabindex</a></div><div class="">The result is that it will never be able to respond to an enter using it’s click handler.</div><div class=""><br class=""></div><div class="">cheers</div><div class="">Johan</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 05 Mar 2015, at 01:18, Laura Risani &lt;<a href="mailto:laura.risani@gmail.com" class="">laura.risani@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Didn't now you can shut down default behavior, interesting.<br class=""></div><div class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Mar 4, 2015 at 6:54 PM, Paul DeBruicker <span dir="ltr" class="">&lt;<a href="mailto:pdebruic@gmail.com" target="_blank" class="">pdebruic@gmail.com</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm not sure but you might could have also just used a 'return false;' at the<br class="">
end of your script to shut off the default behavior.<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
laura wrote<br class="">
<span class="">&gt; Seems that pressing keys space/enter also triggers onClick: . I changed<br class="">
&gt; the<br class="">
&gt; code to<br class="">
&gt; button bePush onClick:aScript<br class="">
&gt; and so onClick: is triggered just once whether for click/any keypress.<br class="">
&gt;<br class="">
&gt; Best,<br class="">
&gt; Laura<br class="">
&gt;<br class="">
</span>&gt; On Mon, Mar 2, 2015 at 8:37 PM, Laura Risani &amp;lt;<br class="">
<br class="">
&gt; laura.risani@<br class="">
<span class=""><br class="">
&gt; &amp;gt; wrote:<br class="">
&gt;<br class="">
&gt;&gt; I'm facing a problem with this code that we mentioned<br class="">
&gt;&gt; html anchor url:’javascript:{}’; onClick: aScript; onKeyDown:aScript<br class="">
&gt;&gt; the problem is that when pressing enter key (while the anchor has focus)<br class="">
&gt;&gt; triggers onKeyDown: (and variants) twice, while pressing any other key<br class="">
&gt;&gt; just does it (as desired) once.<br class="">
&gt;&gt; Is there a way to override this undesired behavior of enter key?<br class="">
&gt;&gt;<br class="">
&gt;&gt;<br class="">
</span>&gt;&gt; On Mon, Mar 2, 2015 at 6:13 PM, Laura Risani &amp;lt;<br class="">
<br class="">
&gt; laura.risani@<br class="">
<br class="">
&gt; &amp;gt;<br class="">
<span class="">&gt;&gt; wrote:<br class="">
&gt;&gt;<br class="">
&gt;&gt;&gt; Hi Johan. I thought for a moment it would do something else...<br class="">
&gt;&gt;&gt; I'll stick then with url:’javascript:{}’<br class="">
&gt;&gt;&gt; Best,<br class="">
&gt;&gt;&gt; Laura<br class="">
&gt;&gt;&gt;<br class="">
</span>&gt;&gt;&gt; On Mon, Mar 2, 2015 at 4:43 PM, Johan Brichau &amp;lt;<br class="">
<br class="">
&gt; johan@<br class="">
<span class=""><br class="">
&gt; &amp;gt; wrote:<br class="">
&gt;&gt;&gt;<br class="">
&gt;&gt;&gt;&gt; Laura,<br class="">
&gt;&gt;&gt;&gt;<br class="">
&gt;&gt;&gt;&gt; That will make your page scroll to the top.<br class="">
&gt;&gt;&gt;&gt; Not always desirable…<br class="">
&gt;&gt;&gt;&gt;<br class="">
&gt;&gt;&gt;&gt; Johan<br class="">
&gt;&gt;&gt;&gt;<br class="">
</span>&gt;&gt;&gt;&gt; On 02 Mar 2015, at 17:23, Laura Risani &amp;lt;<br class="">
<br class="">
&gt; laura.risani@<br class="">
<span class=""><br class="">
&gt; &amp;gt; wrote:<br class="">
&gt;&gt;&gt;&gt;<br class="">
&gt;&gt;&gt;&gt; Seems that same anchor-like rendering by web browsers can be achieved<br class="">
&gt;&gt;&gt;&gt; with url:'#' (instead of url:’javascript:{}’ ).<br class="">
&gt;&gt;&gt;&gt;<br class="">
</span>&gt;&gt;&gt;&gt; On Wed, Feb 18, 2015 at 4:17 PM, Johan Brichau &amp;lt;<br class="">
<br class="">
&gt; johan@<br class="">
<br class="">
&gt; &amp;gt;<br class="">
<span class="">&gt;&gt;&gt;&gt; wrote:<br class="">
&gt;&gt;&gt;&gt;<br class="">
&gt;&gt;&gt;&gt;&gt; Laura,<br class="">
&gt;&gt;&gt;&gt;&gt;<br class="">
&gt;&gt;&gt;&gt;&gt; &gt; I had tried adding "callback:[]" but that renders the whole page<br class="">
&gt;&gt;&gt;&gt;&gt; again.<br class="">
&gt;&gt;&gt;&gt;&gt;<br class="">
&gt;&gt;&gt;&gt;&gt; That’s to be expected.<br class="">
&gt;&gt;&gt;&gt;&gt; I just wanted to make clear that if you do not add a callback, you<br class="">
&gt;&gt;&gt;&gt;&gt; need<br class="">
&gt;&gt;&gt;&gt;&gt; to set a url (href attribute) yourself or the browser will not show it<br class="">
&gt;&gt;&gt;&gt;&gt; as a<br class="">
&gt;&gt;&gt;&gt;&gt; (clickable) link.<br class="">
&gt;&gt;&gt;&gt;&gt;<br class="">
&gt;&gt;&gt;&gt;&gt; Johan_______________________________________________<br class="">
&gt;&gt;&gt;&gt;&gt; seaside mailing list<br class="">
&gt;&gt;&gt;&gt;&gt;<br class="">
<br class="">
</span>&gt; seaside@.squeakfoundation<br class="">
<span class=""><br class="">
&gt;&gt;&gt;&gt;&gt; <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank" class="">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br class="">
&gt;&gt;&gt;&gt;&gt;<br class="">
&gt;&gt;&gt;&gt;<br class="">
&gt;&gt;&gt;&gt; _______________________________________________<br class="">
&gt;&gt;&gt;&gt; seaside mailing list<br class="">
&gt;&gt;&gt;&gt;<br class="">
<br class="">
</span>&gt; seaside@.squeakfoundation<br class="">
<span class=""><br class="">
&gt;&gt;&gt;&gt; <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank" class="">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br class="">
&gt;&gt;&gt;&gt;<br class="">
&gt;&gt;&gt;&gt;<br class="">
&gt;&gt;&gt;&gt;<br class="">
&gt;&gt;&gt;&gt; _______________________________________________<br class="">
&gt;&gt;&gt;&gt; seaside mailing list<br class="">
&gt;&gt;&gt;&gt;<br class="">
<br class="">
</span>&gt; seaside@.squeakfoundation<br class="">
<span class=""><br class="">
&gt;&gt;&gt;&gt; <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank" class="">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br class="">
&gt;&gt;&gt;&gt;<br class="">
&gt;&gt;&gt;&gt;<br class="">
&gt;&gt;&gt;<br class="">
&gt;&gt;<br class="">
&gt;<br class="">
&gt; _______________________________________________<br class="">
&gt; seaside mailing list<br class="">
<br class="">
</span>&gt; seaside@.squeakfoundation<br class="">
<br class="">
&gt; <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank" class="">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br class="">
<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
--<br class="">
View this message in context: <a href="http://forum.world.st/Anchor-appearance-when-script-attached-tp4806275p4809599.html" target="_blank" class="">http://forum.world.st/Anchor-appearance-when-script-attached-tp4806275p4809599.html</a><br class="">
Sent from the Seaside General mailing list archive at <a href="http://Nabble.com" class="">Nabble.com</a>.<br class="">
<div class="HOEnZb"><div class="h5">_______________________________________________<br class="">
seaside mailing list<br class="">
<a href="mailto:seaside@lists.squeakfoundation.org" class="">seaside@lists.squeakfoundation.org</a><br class="">
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank" class="">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br class="">
</div></div></blockquote></div><br class=""></div>
_______________________________________________<br class="">seaside mailing list<br class=""><a href="mailto:seaside@lists.squeakfoundation.org" class="">seaside@lists.squeakfoundation.org</a><br class="">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside<br class=""></div></blockquote></div><br class=""></div></body></html>