![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
Stanimir Stamenkov wrote: Thu, 1 May 2008 16:16:49 -0700 (PDT), /Prisoner at War/: I have a hyperlink that doesn't point to another document, but is used to call forth a modal window onClick (or is there another way, without text or image links, of calling forth JavaScript on user activity??). I would like to spare my visitors the inconvenience and visually jarring effect of getting thrown back up to the top of the page! =( If the element is not really a hyper link why marking it as such? Better use generic SPAN element or A(nchor) element without 'href' and attach 'click' handler to it. This will spare your visitors the confusion with encountering hyper links which are not really hyper links. However, this reasoning is flawed because the confusion of the user about what looks like a control that does not appear to work remains. |
#2
| |||
| |||
|
|
In this regard I think it is better to style a SPAN like a button (or whatever is appropriate) and attach a custom script action to it, rather than abusing a hyper link element for that purpose. |
#3
| |||
| |||
|
|
Fri, 02 May 2008 19:10:32 +0300, /Stanimir Stamenkov/: In this regard I think it is better to style a SPAN like a button (or whatever is appropriate) and attach a custom script action to it, rather than abusing a hyper link element for that purpose. Hyper-link elements - HTML <A> elements with 'href' attribute specified. <A> element without 'href' is not a hyper-link so it is perfectly possible to use it in place of SPAN, also. |
#4
| |||
| |||
|
|
Stanimir Stamenkov <s7an10 (AT) netscape (DOT) net> writes: Hyper-link elements - HTML <A> elements with 'href' attribute specified. <A> element without 'href' is not a hyper-link so it is perfectly possible to use it in place of SPAN, also. But then you'd have to differentiate between "pure anchors"; <a name="something"> and "my special click thingies": <a onclick="dostuff()">. Still better to use a span or a div. |
|
Authors may also create an A element that specifies no anchors, i.e., that doesn't specify href, name, or id. Values for these attributes may be set at a later time through scripts. |
#5
| |||
| |||
|
|
Fri, 02 May 2008 19:49:36 +0200, /Joost Diepenmaat/: Stanimir Stamenkov <s7an10 (AT) netscape (DOT) net> writes: Hyper-link elements - HTML <A> elements with 'href' attribute specified. <A> element without 'href' is not a hyper-link so it is perfectly possible to use it in place of SPAN, also. But then you'd have to differentiate between "pure anchors"; <a name="something"> and "my special click thingies": <a onclick="dostuff()">. Still better to use a span or a div. Is there anything ambiguous in differentiating a named anchor or link and an <A> element which does not specify an anchor? At least the HTML specification states (a bit down below) http://www.w3.org/TR/html401/struct/links.html#edef-A>: Authors may also create an A element that specifies no anchors, i.e., that doesn't specify href, name, or id. Values for these attributes may be set at a later time through scripts. |
![]() |
| Thread Tools | |
| Display Modes | |
| |