468,119 Members | 2,060 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,119 developers. It's quick & easy.

On-Page Anchors not working properly

Strangely, on-page anchors will work on MSIE, but not on Netscape7.2
or Firefox1.5. All anchors are numbers e.g. <a href="#21">TOPIC</a>
supposed to connect down to <a name="#21>beginning of text</a> .

Could be further complicated by the ASP and SQL designation of URL.
like: http://sampleURL.org/FAQs.asp?FAQMID...=10&bmode=Main
W3C validator said 91 errors, mostly on tables, fonts and graphics,
but didn't seem to complain about anchors. Any ideas? TIA Rich
Dec 8 '05 #1
12 2153
Deciding to do something for the good of humanity, Rich
<ri***********@ntplx.net> spouted in
comp.infosystems.www.authoring.html:
<a href="#21">TOPIC</a> <snip> supposed to connect down to <a name="#21>beginning of text</a> .


No, it links to id="21" or name="21".

You haven't closed the quote on the name attribute. And if you want to
link to "#21", you would need use href="##21".

--
Mark Parnell
================================================== ===
Att. Google Groups users - this is your last warning:
http://www.safalra.com/special/googlegroupsreply/
Dec 8 '05 #2
In our last episode,
<43***************@ntplx.net>,
the lovely and talented Rich
broadcast on comp.infosystems.www.authoring.html:
Strangely, on-page anchors will work on MSIE, but not on Netscape7.2
or Firefox1.5. All anchors are numbers e.g. <a href="#21">TOPIC</a>
supposed to connect down to <a name="#21>beginning of text</a> .
NAME (ID) attributes must begin with a letter.
Could be further complicated by the ASP and SQL designation of URL.
like: http://sampleURL.org/FAQs.asp?FAQMID...=10&bmode=Main
W3C validator said 91 errors, mostly on tables, fonts and graphics,
but didn't seem to complain about anchors. Any ideas? TIA Rich


--
Lars Eighner us****@larseighner.com http://www.larseighner.com/
War on Terrorism: The Difference Between Us and Them
"We should invade their countries, kill their leaders and
convert them to Christianity." -- Ann Coulter
Dec 8 '05 #3
Deciding to do something for the good of humanity, Lars Eighner
<us****@larseighner.com> spouted in comp.infosystems.www.authoring.html:
NAME (ID) attributes must begin with a letter.


The name attribute is CDATA[1], not ID.
http://www.w3.org/TR/html4/struct/li...ml#adef-name-A

[1] Except on the meta element, where it is NAME.

--
Mark Parnell
================================================== ===
Att. Google Groups users - this is your last warning:
http://www.safalra.com/special/googlegroupsreply/
Dec 8 '05 #4
Mark Parnell, in an effort for more picturesque speech, wrote::

Deciding to do something for the good of humanity, Lars Eighner
<us****@larseighner.com> spouted in comp.infosystems.www.authoring.html:
NAME (ID) attributes must begin with a letter.


The name attribute is CDATA[1], not ID.
http://www.w3.org/TR/html4/struct/li...ml#adef-name-A

[1] Except on the meta element, where it is NAME.

--
Mark Parnell
================================================== ===
Att. Google Groups users - this is your last warning:
http://www.safalra.com/special/googlegroupsreply/


The quotes are actually closed, that was a typo of mine.
So we are learning that, advise if wrong
1. the name of the name, no pun intended, must start with
an alpha character, not a number or other symbol.
2. destination name must only say <name=""> NOT <a name="">??
3. the origination uses the #"" the destination only gets only "".

I am going to look this up in my HTLM for Dummies manual :-)
ID is a newer arrangement, will find out how that works too.
Apparently the long URL is not also a factor in this problem.
But ain't first MSIE/Netscape/FireFox mixup we have discovered,
they once gave us http:\\www. etc, that link worked on Exploder.
Thanks muchly, Rich
Dec 8 '05 #5
Deciding to do something for the good of humanity, Rich
<ri***********@ntplx.net> spouted in
comp.infosystems.www.authoring.html:
The quotes are actually closed, that was a typo of mine.
Good reason to post a URL instead of just snippets of code.
So we are learning that, advise if wrong
1. the name of the name, no pun intended, must start with
an alpha character, not a number or other symbol.
Wrong. See my reply to Lars. Though it may be a good idea anyway. But
technically it can start with any letter in the page's character set.
2. destination name must only say <name=""> NOT <a name="">??
Definitely wrong. Not sure where you got that idea from.
3. the origination uses the #"" the destination only gets only "".
Correct. Whatever the "destination" you are linking to is, add a # to
the beginning for the link.
ID is a newer arrangement, will find out how that works too.
Using id instead of name has been around since HTML4, which was
published in 1998. All modern browsers support it, as does IE.
Apparently the long URL is not also a factor in this problem.


No. But it is part of your validation problems - the ampersands (&)
should be encoded as &amp;

--
Mark Parnell
================================================== ===
Att. Google Groups users - this is your last warning:
http://www.safalra.com/special/googlegroupsreply/
Dec 8 '05 #6
Mark Parnell wrote:
So we are learning that, advise if wrong
1. the name of the name, no pun intended, must start with
an alpha character, not a number or other symbol.
Wrong. See my reply to Lars. Though it may be a good idea anyway. But
technically it can start with any letter in the page's character set.


The formal syntax declares the NAME attribute as CDATA, which means
"anything goes" - it may contain any _Unicode characters_ (not just
letters). The ID attribute is a different story, of course: its value
must be an identifier.

On the other hand, to be useful, the value of a NAME attribute in an A
element needs to be of a form that is allowed in a URL. This imposes
essential restrictions.

On the practical side, it is best to use only lowercase ASCII letters a
to z, digits 0 to 9, and perhaps hyphen "-" in anchor names. Anything
else tends to cause problems.
Using id instead of name has been around since HTML4, which was
published in 1998. All modern browsers support it, as does IE.


Some people say that Netscape 4, which does not understand ID, still has
a nonneglible market share.
Dec 8 '05 #7
On Thu, 8 Dec 2005, Jukka K. Korpela wrote:
Some people say that Netscape 4, which does not understand ID, still has
a nonneglible market share.


Not even Peter T. Daniels uses Netscape 4.

--
Netscape 3.04 does everything I need, and it's utterly reliable.
Why should I switch? Peter T. Daniels in <news:sci.lang>

Dec 8 '05 #8
Mark Parnell wrote:
Deciding to do something for the good of humanity, Rich
<ri***********@ntplx.net> spouted in
comp.infosystems.www.authoring.html:

<a href="#21">TOPIC</a>


<snip>
supposed to connect down to <a name="#21>beginning of text</a> .

No, it links to id="21" or name="21".

You haven't closed the quote on the name attribute. And if you want to
link to "#21", you would need use href="##21".


If he cares about correctness of his code, rather than just whether it
happens to work in particular browsers, he won't have ID or NAME
attributes that contain "#" or begin with a digit.
Dec 8 '05 #9
Deciding to do something for the good of humanity, "Jukka K. Korpela"
<jk******@cs.tut.fi> spouted in comp.infosystems.www.authoring.html:
The formal syntax declares the NAME attribute as CDATA, which means
"anything goes" - it may contain any _Unicode characters_ (not just
letters).
Indeed - carelessness on my part. I meant to say character, not letter.
Some people say that Netscape 4, which does not understand ID, still has
a nonneglible market share.


I'm not one of those people (though admittedly to some extent it could
be site-dependent). :-)

--
Mark Parnell
================================================== ===
Att. Google Groups users - this is your last warning:
http://www.safalra.com/special/googlegroupsreply/
Dec 8 '05 #10
Mark Parnell wrote:

Deciding to do something for the good of humanity, "Jukka K. Korpela"
<jk******@cs.tut.fi> spouted in comp.infosystems.www.authoring.html:
The formal syntax declares the NAME attribute as CDATA, which means
"anything goes" - it may contain any _Unicode characters_ (not just
letters).


Indeed - carelessness on my part. I meant to say character, not letter.
Some people say that Netscape 4, which does not understand ID, still has
a nonneglible market share.


I'm not one of those people (though admittedly to some extent it could
be site-dependent). :-)

--
Mark Parnell
================================================== ===
Att. Google Groups users - this is your last warning:
http://www.safalra.com/special/googlegroupsreply/


Once upon a time...
Anyway, thanks for the re-education, I downloaded, fixed it so
<a href="#xx">link</a> now links to <a name="xx">ref.text</a>.
Thought nesting problem, it's buried very deep, but it works.

Now all I have to do is convince the webmaster to revise it so
it will work in other browsers besides IE. I've been doing the
same thing for five years now :-) BTW this is N4.78 on IBM PS/2
w/win95, also WFW3.11/N3.04 on other hard drive. TNX Rich CT USA
Dec 9 '05 #11

On Thu, 8 Dec 2005, Mark Parnell wrote:
Deciding to do something for the good of humanity, Rich
<ri***********@ntplx.net> spouted in
comp.infosystems.www.authoring.html:

[snip]
ID is a newer arrangement, will find out how that works too.


Using id instead of name has been around since HTML4, which was
published in 1998. All modern browsers support it, as does IE.

[snip]

Including my browser of choice, Lynx 2.7 (just tested). (Whether anyone
would consider that version of Lynx to be modern is another story.)

--
Norman De Forest http://www.chebucto.ns.ca/~af380/Profile.html
af***@chebucto.ns.ca [=||=] (At the Sign of the Flashing Cursor)
"Oh how I miss the days when it was easier to catch gonorhea than a
computer virus." -- Big Will in alt.comp.virus, March 9, 2005

Dec 21 '05 #12
Tue, 20 Dec 2005 21:08:48 -0400 from Norman L. DeForest <af380
@chebucto.ns.ca>:

On Thu, 8 Dec 2005, Mark Parnell wrote:
Deciding to do something for the good of humanity, Rich
<ri***********@ntplx.net> spouted in
comp.infosystems.www.authoring.html:

[snip]
ID is a newer arrangement, will find out how that works too.


Using id instead of name has been around since HTML4, which was
published in 1998. All modern browsers support it, as does IE.

[snip]

Including my browser of choice, Lynx 2.7 (just tested). (Whether anyone
would consider that version of Lynx to be modern is another story.)


Netscape 4 didn't support ID, but if I recall correctly IE 4 did.
Netscape 6 id, as did all the Mozilla and Firefox releases.

--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
HTML 4.01 spec: http://www.w3.org/TR/html401/
validator: http://validator.w3.org/
CSS 2.1 spec: http://www.w3.org/TR/CSS21/
validator: http://jigsaw.w3.org/css-validator/
Why We Won't Help You:
http://diveintomark.org/archives/200..._wont_help_you
Dec 21 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Frank | last post: by
1 post views Thread by David Walker | last post: by
3 posts views Thread by TJ | last post: by
3 posts views Thread by Bruce W.1 | last post: by
6 posts views Thread by Hasan Ceylan | last post: by
4 posts views Thread by Artem | last post: by
2 posts views Thread by Stuart Rogers | last post: by
14 posts views Thread by didacticone | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.