does Opera have an issue with <href="#"> ....?

E

Els

flix said:
hi,

using opera 9.1

my links "back to top of page" don't work.

<href="#">top</a>

That's not an Opera issue, but a coding issue.

<body>
<div><a name="top"> </a></div>
......
<a href="#top">go to top of page</a>
 
J

Jukka K. Korpela

Scripsit Els:
That's not an Opera issue, but a coding issue.

Actually, it _is_ an Opera issue. The URL reference "#" has a well-defined
meaning.

On the other hand, "back to top of page" links are worse than useless. Some
users might actually find them useful, but only because they don't know the
simple tools of their browsers. Others see the distracting pointless links.
<a href="#top">go to top of page</a>

Well, that's a bit worse. An adequate link text seldom contains a verb
(predicate) and hardly ever in the imperative.
 
E

Els

Jukka said:
Scripsit Els:


Actually, it _is_ an Opera issue. The URL reference "#" has a well-defined
meaning.

Yes, but <href is missing the 'a' part.
On the other hand, "back to top of page" links are worse than useless. Some
users might actually find them useful, but only because they don't know the
simple tools of their browsers. Others see the distracting pointless links.

Pointless for some, useful for others. I've been navigating long pages
in my phone browser, and 'back to top' is a lot quicker than scrolling
per page (no home button on the phone).
I'd rather have 10 'to top' links than 3 Google ads in the sidebar,
it's all a matter of preference.
Well, that's a bit worse. An adequate link text seldom contains a verb
(predicate) and hardly ever in the imperative.

Is it your nitpick day today? :)
 
B

Bergamot

Els said:
<div><a name="top"> </a></div>

better: <div id="top">

AFAIK, this works the same as a named anchor in all browsers except
Netscape 4, and who uses that any more?
 
F

flix

thanks to all for input, and of course I did mean <a href ..> forgot the
"a" ...

i had always assumed that the href # was an HTML convention; IE and FF have
no problem with it. It seems like an oversight that Opera coders couldn't
allow for this. Harumph.

google search for <a href="#"> yields 63 million matches.
google search for <a href="#top"> yields 488 results.

i think that kind of says it all, right there.

Opera, baby, if you want to move out of the
fraction-of-one-percent-of-web-users niche, you gotta get your two-by-four
out of your kazoo.
 
B

Bergamot

flix said:
google search for <a href="#"> yields 63 million matches.

I suspect many millions of those aren't what you think they are.
<a href="#"> is commonly used for JavaScript links. Whether that is a
good practice or not is another matter, of course.
 
F

flix

Bergamot said:
I suspect many millions of those aren't what you think they are.
<a href="#"> is commonly used for JavaScript links. Whether that is a
good practice or not is another matter, of course.

You're right Berg.

I further qualified my search:

google: <a href="#"> + "top of page" this yields half-a-million
matches
google: <a href="#top"> + "top of page" this yields 28 matches.

I think I'll go sip on some Early Grey Tea!!
 
D

Dan

I suspect many millions of those aren't what you think they are.
<a href="#"> is commonly used for JavaScript links. Whether that is a
good practice or not is another matter, of course.

And many of those JavaScript coders are too stupid or ignorant to at
least include a "return false" at the end of their script to stop the
annoying jump to the top of the page that occurs when the user clicks
on the link, after the script runs.
 
J

Jukka K. Korpela

Scripsit Els:
Yes, but <href is missing the 'a' part.

Oh, I missed that. But the fixed code still does not work on Opera.
- -
Pointless for some, useful for others. I've been navigating long pages
in my phone browser, and 'back to top' is a lot quicker than scrolling
per page (no home button on the phone).

There's surely a quick way to get to the top on your browser. You just
haven't found it yet, and satisfaction with some back to top links helps you
avoid finding the solution. :)
Is it your nitpick day today? :)

No, it is quite normal for me to comment on answers that point to a wrong
direction.
 
T

Toby A Inkster

flix said:
i had always assumed that the href # was an HTML convention; IE and FF have
no problem with it. It seems like an oversight that Opera coders couldn't
allow for this. Harumph.

It's not "couldn't", but "chose not to". Opera 8.x and below *did*
recognise a link to "#" as a link to the top of the page. This was
*changed* in Opera 9.x to the behaviour described in this thread.

The new behaviour is far more useful because it means that links like:

<a href="#" onclick="javascript:....">

don't take you up to the top of the page when clicked. If people want to
go to the top of the page, they can just hit the "Home" key on their
keyboard to get back to the top of the page. One of Opera's main selling
points is its superb keyboard navigation, so a good percentage of regular
Opera users are familiar with and frequently use keyboard shortcuts like
this.

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
 
J

Jukka K. Korpela

Scripsit Toby A Inkster:
The new behaviour is far more useful because it means that links like:

<a href="#" onclick="javascript:....">

don't take you up to the top of the page when clicked.

That is, they do not work according to specifications.

I can see the pragmatic reasons for doing that, but it's really
disappointing that Opera takes the path of guessing what the author really
wants and trying to do that, even if that means violating published
specifications. I thought such behavior was a trademark or patented
invention of Microsoft, or something.
If people want
to go to the top of the page, they can just hit the "Home" key on
their keyboard to get back to the top of the page.

Surely, but that's no excuse for a browser to refuse to follow the
specifications.

(I could play Devil's advocate and develop a defence for this feature,
saying that Opera _does_ process the URL "#" by the specs but it does not
position the current document at the start, since no such behavior is
_required_ - it's just the reasonable thing that browsers have done from the
early days. No specification says how a browser should really react when you
follow a link with href="#foo" or href="#", though such links have defined
logical meanings. Who says that when following a link referring to "foo",
the browser should in any way help the user by showing the element referred
to and not some random place in the document? :) )
 
E

Els

Jukka said:
Scripsit Els:

Oh, I missed that. But the fixed code still does not work on Opera.

My fix does - I wrote <a href="#top">, not <a href="#">.
As I always use #top, I don't remember ever noticing the Opera
problem.
There's surely a quick way to get to the top on your browser. You just
haven't found it yet, and satisfaction with some back to top links helps you
avoid finding the solution. :)

Even if that were true (which it isn't!), I'm happy to provide
"superfluous" back to top links for those who haven't discovered the
home button on their browser, for whatever reason. Also, just like I
prefer to use my keyboard far more than my mouse, some people surf the
web mainly by mouse - I think they prefer back to top links[1] too.

BTW - is that a smiley you typed at the end of that sentence? I don't
remember ever seeing smileys in your posts - is it your first? ;-)
No, it is quite normal for me to comment on answers

No kidding!
that point to a wrong direction.

I think that 'wrong direction' is subject to personal opinion most of
the time, and the level of wrongness defines whether a comment is
nitpick or correction. In this case, my personal opinion of the level
of wrongness of my advice is clearly different from yours :)

_______
[1] Shouldn't 'back to top' also be wrong? Who says I came from the
top? I could have followed a link from elsewhere to an anchor in the
middle of the page. So, nitpicking and all, I reckon it should just be
"to top" links, not "back to top".
 
T

Toby A Inkster

Jukka said:
I could play Devil's advocate and develop a defence for this feature,
saying that Opera _does_ process the URL "#" by the specs but it does not
position the current document at the start, since no such behavior is
_required_

Or that a link such as '<a href="#">' is not *supposed* to do anything
according to RFC 1738, which states that the fragment identifier is *after*
the hash character, so the link is equivalent to '<a href="">' which is
equivalent to '<a>', so shouldn't do anything. :)

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux

* = I'm getting there!
 
J

Jukka K. Korpela

Scripsit Els:
Even if that were true (which it isn't!),

If it isn't true, get a new browser or complain loudly to the vendor. It's
comparable to having no scrolling mechanism. Should authors add "previous
paragraph" and "next paragraph" links as well, on the grounds that some
browsers may lack functions for moving backward and forward?
I'm happy to provide
"superfluous" back to top links for those who haven't discovered the
home button on their browser, for whatever reason.

It's a wrong decision, because they _are_ superfluous and add distraction
and even potential confusion. (Did you check my page of arguments against
"to top" links?) For example, those who want or need to move between links
using the tab key will _not_ like "to top" links between useful links.
Also, just like I
prefer to use my keyboard far more than my mouse, some people surf the
web mainly by mouse - I think they prefer back to top links[1] too.

On the great majority of pages, they won't find such links, so they need to
work things out anyway. Once they do that, they can use either the keyboard
or the mouse (e.g., using the scrollbar) to get to the top on _any_ page.
[1] Shouldn't 'back to top' also be wrong?

Of course.
Who says I came from the top?

The misguided author who copies an idea or even code from pages where the
idea has been copied etc. There may have been an _original_ idea behind
this, but it was wrong. Most probably it was meant to help people, but it
didn't.
I reckon it should just be
"to top" links, not "back to top".

No, the "back" issue is distinct from the "to" or "go to" issue. Both are
wrong, as is the basic idea. I commented on adding the "go to" part. Well,
you _could_ be even more wrong, e.g. "Click on this to go back to top!".
 
J

Jukka K. Korpela

Scripsit Toby A Inkster:
Or that a link such as '<a href="#">' is not *supposed* to do anything
according to RFC 1738, which states that the fragment identifier is
*after* the hash character, so the link is equivalent to '<a
href="">' which is equivalent to '<a>', so shouldn't do anything. :)

As regards to generic URL (URI) syntax, which is what your statement is
about, RFC 1738 was obsoleted in August 1998 by RFC 2396, which itself was
obsoleted by RFC 3986 in January 2005.

By the specifications, <a href="#"> is indeed equivalent to <a href="">, but
this in turn is not dummy but "same-document reference", a link to the
document itself, and normally interpreted as referring to the _start_ of
document.
 

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
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top