name anchor problem

P

proden

I have a website with some name anchors in it, like <a
href="#mp3">Mp3s</a>

The problem is that my error reporting system with a certain regularity
reports about people trying to reach for example:
http://www.mysite.com/mydir/cmb.htm#mp3. As the referring page
mentioned is the page itself and the browser mentioned is just IE or
Mozilla I am wondering what is causing this problem.

One of the options is that it might have to do with my charset utf-8.

I hope anyone recognizes this phenomena and can tell me what causes it.

Thanks,

Mij
 
J

Jukka K. Korpela

Scripsit (e-mail address removed):
I have a website with some name anchors in it, like <a
href="#mp3">Mp3s</a>

That's not a name anchor. It's a link that refers to an element in the same
document using a fragment identifier, which _might_ be defined using a name
anchor ( said:
The problem is that my error reporting system with a certain
regularity reports about people trying to reach for example:
http://www.mysite.com/mydir/cmb.htm#mp3.

Really? So where is the URL of your site? I am actually rather sure that you
gave a forged URL. Yes, it's forged, because it's intentionally wrong,
incorrect by fabrication. The URL http://www.mysite.com/mydir/cmb.htm gives
a 404 error message, but it's a URL under control of the mysite.com domain.

If you don't want to reveal the real URL, i.e. if you don't want to be
helped, at least use the .example convention to indicate a fictitious URL
that is guaranteed not to coincide with a real URL.
As the referring page
mentioned is the page itself and the browser mentioned is just IE or
Mozilla I am wondering what is causing this problem.

The odds are that you have a badly written link on your page.
One of the options is that it might have to do with my charset utf-8.

The character "#" has the same representation in UTF-8 as in ASCII, ISO 8859
encodings, and many more. But of course if your page isn't _actually_ UTF-8
encoded though declared to be, or vice versa, which is not very uncommon,
anything may happen.
 
K

keeper

<a href="#bookmark">Click here to skip ahead</a>
<a name="bookmark"><strong>cool! you skipped ahead!</strong></a>

thats how ive always done it, and ve never had problems with it on
firefox or any other browser, in ISO-9958-1 or UTF-8. maybe you have
your # in teh wrong element ?
 
J

Jonathan N. Little

keeper wrote:

Please don't top post keeper,
<a href="#bookmark">Click here to skip ahead</a>
<a name="bookmark"><strong>cool! you skipped ahead!</strong></a>

Better and a bit more modern:

<a href="#bookmark">Click here to skip ahead</a>
....
<p id="bookmark"><strong>Cool! you skipped ahead!</strong>...

element IDs can accessed as anchors with document. Saves the superfluous
<a name="someAnchor"></a> markup...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top