Click here to get back home

Re: aPossible to Make A "Dummy" Anchor Tag **without** Jumping Back Up???

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Re: aPossible to Make A "Dummy" Anchor Tag **without** Jumping Back Up??? Stanimir Stamenkov 05-02-2008
Posted by Stanimir Stamenkov on May 2, 2008, 12:10 pm
Please log in for more thread options
Followup-To: comp.infosystems.www.authoring.html

On 02.5.2008 г. 04:21, /Thomas 'PointedEars' Lahn/:
> 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.

I agree HTML Form controls (non-submit buttons) should be used
whenever possible, but as far as I know people avoid them because
they are "harder" to style (they are replaced elements the styling
of which is non-standardized, currently). Styling is the main
reason people abuse hyper links instead of using standard form buttons.

Scripting is used to implement non-standard UI controls, too. The
Google Maps map, for instance. It can't be "expressed" using
standard form controls and it can't possibly work without full
scripting and styling support. 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.

--
Stanimir

Posted by Stanimir Stamenkov on May 2, 2008, 12:27 pm
Please log in for more thread options
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.

--
Stanimir

Posted by Joost Diepenmaat on May 2, 2008, 1:49 pm
Please log in for more thread options

> 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.

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.

If styling form controls wasn't so annoying, I'd always recommend
<button>. As it is, it's just too hard to style portably in some
cases.

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/

Posted by Stanimir Stamenkov on May 2, 2008, 2:07 pm
Please log in for more thread options
Fri, 02 May 2008 19:49:36 +0200, /Joost Diepenmaat/:
>
>> 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.

Until href, name, or id gets set the <A> element doesn't signify an
anchor. Similar case would be:

<ul>
<li><a href="section1">Section 1</a></li>
<li><a href="section2">Section 2</a></li>
<li><a>Section 3</a></li>
<li><a href="section4">Section 4</a></li>
</ul>

The given list used as navigational menu in a multi-page document
where the current page is "Section 3".

--
Stanimir

Posted by Joost Diepenmaat on May 2, 2008, 3:21 pm
Please log in for more thread options

> Fri, 02 May 2008 19:49:36 +0200, /Joost Diepenmaat/:
>>
>>> 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.

Now that you mention it, I'm not sure I stand by my initial
assessment. The main reason I still wouldn't use A here, is that I
generally use unqualified CSS styles for links, which would make all
of these uses look the same (though A NAME anchors can be empty).

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/

Similar ThreadsPosted
make area around anchor be clickable? April 22, 2005, 10:05 am
jumping fieldsets problem - IE only July 6, 2005, 10:37 pm
Jumping link on Firefox November 29, 2006, 8:08 pm
Not the browsers, dummy, the search engines February 10, 2007, 10:11 am
Hiding an anchor tag September 1, 2006, 1:31 am
Anchor tags IE 7 February 25, 2007, 8:23 pm
In page anchor problem July 19, 2004, 8:00 am
FF: anchor links not working.. February 8, 2006, 10:52 am
Why does named anchor fail? August 8, 2006, 8:44 pm
html anchor tag displayed in middle not top October 11, 2005, 8:30 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap