Re: [NH] Link to Bookmark Opens Page Unexpectedly
- Interviewed by CNN on 17/05/2012 20:02, Ray Shapp told the world:
> To All,Well, first thing thing to try is to validate the page. And...
> MSIE v9.0 and Firefox v12.0 both open one of my web pages slightly above
> the location of an embedded anchor.
> The link is:
> In both browsers, the page opens about nine lines above the line where the
> anchor is embedded. That's acceptable, but I'm wondering if that's normal
> behavior. IOW are the browsers showing me a bit of the page above the
> anchor so as to show me the context, or is this happening because I've
> embedded a third-party calendar at the top of the page.
> Did I code the embedded bookmark incorrectly or am I addressing it
> incorrectly? Or is there some other issue I'm missing?
... http://validator.w3.org throws an error PRECISELY on your anchor:
Validation Output: 1 Error
Error /Line 75, Column 30/: document type does not allow element "A" here
The element named above was found in a context where it is not allowed.
This could mean that you have incorrectly nested elements -- such as a
"style" element in the "body" section instead of inside "head" -- or two
elements that overlap (which is not allowed).
Furthermore, you have the SAME anchor repeated ABOVE the "Solar Viewing
at Trailside." Look for the line:
<a name="starparty2012-05-19" id="starparty2012-05-19"></a>
Which is exactly where the browsers are opening the link. That is, they are looking for the first occurrence of the anchor, and finding it there.
As a general guideline, <a name="..."> anchors are something to wean oneself off. Try using 'id="..."' for anchors, they tend to be much more versatile.
This message has been protected with the 2ROT13 algorithm. Unauthorized
use will be prosecuted under the DMCA.
This message has been protected with the 2ROT13 algorithm. Unauthorized use will be prosecuted under the DMCA.
- Marcelo Bastos wrote:
> As a general guideline, <a name="..."> anchors are somethingIn principle yes, in practice I do just the opposite, but that's because
> to wean oneself off. Try using 'id="..."' for anchors, they
> tend to be much more versatile.
backwards compatibilty to even the oldest browsers without loss of main
content is important to me. If you don't mind Netscape 4 not finding the
ancor, ID is fine.
Dipl.-Ing. F. Axel Berger Tel: +49/ 2174/ 7439 07
Johann-Häck-Str. 14 Fax: +49/ 2174/ 7439 68
D-51519 Odenthal-Heide eMail: Axel-Berger@...
Deutschland (Germany) http://berger-odenthal.de
- Hi Axel,
On 18 May 12 00:46 Axel Berger <Axel-Berger@...> said:
> If you don't mind Netscape 4 not finding theI take it the audience for your site is a computing museum. That
> ancor, ID is fine.
browser must be getting on for 20 years old.
The principle of backwards compatibility is fair enough, but in the
real world there comes a point when it's time to move on. Do you keep
a sabre-toothed tiger chained up in your back yard to keep the wooly
mamoths away? No doubt you'll tell me it's very effective as you have
seen any mamoths near your house since you got the tiger.
- Greg Chapman wrote:
> but in theI'd like to contradict heatedly, but in this case you're probably right
> real world there comes a point when it's time to move on.
- page anchors are not essential and breaking them is merely
inconvenient, not disabling.
Still, as I use Netscape 4.8 for writing this post and won't change
anytime soon, and as long as Netscape 4.8 is my standard test
environment for no script, no CSS, no graphics, I won't stop catering
for it in my own pages.
> as you haveHaven't had a decent mammoth steak in ages. It's got so bad, I don't
> seen any mamoths near your house since you got the tiger.
even keep hafted Levallois points in readiness any more. But I read that
for delicate surgery ceramic knives make a comeback and I believe in
special cases flint or obsidian is preferable to synthetic ceramics.
- Hi Axel,
On 18 May 12 03:20 Axel Berger <Axel-Berger@...> said:
> Still, as I use Netscape 4.8 for writing this post and won't changeIn that case I understand. I'd probably still use Lynx for that
> anytime soon, and as long as Netscape 4.8 is my standard test
> environment for no script, no CSS, no graphics, I won't stop
> catering for it in my own pages.
- Hi Greg, Axel, and Marcelo,
Greg and Axel, you break me up!
Marcelo, I thought I did validate the page. When I view source in Firefox,
I see an HTML Validator screen that shows 0 errors and 0 warnings. Maybe I
tweaked the page after I validated it.
Bottom line: With your help (along with a good laugh), I'm now using ID in
the table row, and the link behaves as expected, but not tested in any of
last century's browsers.
On Thu, May 17, 2012 at 7:19 PM, Greg Chapman <gregchapmanuk@...>wrote:
> Hi Ray,
> On 18 May 12 00:02 Ray Shapp <rayshapp@...> said:
> > The link is:
> > http://asterism.org/events/events01.htm#starparty2012-05-19
> > In both browsers, the page opens about nine lines above the line
> > where the anchor is embedded.
> Not from where I look. The anchor (duplicated!) is above the table.
> Why not add an ID to the appropriate table row rather than use an
> <tr id="starparty2012-05-19">
[Non-text portions of this message have been removed]