homepage Welcome to WebmasterWorld Guest from 54.198.148.191
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Accredited PayPal World Seller

Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Link to 'Named Anchor' doesn't work in IE
...but it does in FF
Storyman




msg:566941
 6:56 pm on Dec 8, 2004 (gmt 0)

At the top of the page there is an anchor "top" and scattered throughout the body are graphic links that are suppose to take the user to the "top" anchor.

It doesn't work in IE, but does in FF. A search for the solution hasn't been helpful.

How can it be fixed--or can it?

<body>
<a name="top" id="top"></a>

............................

<a href="#top"><img src="images/top_arrow.gif" width="19" height="19" border="0" /></a>

 

rocknbil




msg:566942
 7:07 pm on Dec 8, 2004 (gmt 0)

Did you try making the name and ID different values, instead of them both being "top"?

encyclo




msg:566943
 7:18 pm on Dec 8, 2004 (gmt 0)

I've come accross this problem before but was never able to sufficiently pin it down, as it was sporadic (and I didn't have the time to do exhaustive testing).

The quick and easy way to fix this when you want to go to the top of page is to link simply to "#" and remove the top anchor completely: this should work cross-browser.

Storyman




msg:566944
 8:16 pm on Dec 8, 2004 (gmt 0)

rocknbil,

It isn't clear to me why you advise changing the anchor from "top" to something else. This a component to an input page. The way it is structured there are 20 input boxes. Each input box has an anchor (which is structured the same way as the "top" anchor). Along the left side there is a list of twenty links with each associated to a different input box.

All twenty of those links work. What throws me is that for some reason the one link to the top of the page (which is scattered throughout the page) does not work like the others. Go figure.

encyclo,

Your solution worked. Here is my revised version:

<body>
// This line deleted...<a name="top" id="top"></a>

............................
// #top changed to #
<a href="#"><img src="images/top_arrow.gif" width="19" height="19" border="0" /></a>

As I mentioned to rocknbil, there are twenty other anchor links on the page that do work.

If anyone has any clue as to why this repeated anchor link does not work like the others (that do work) please comment.

Storyman




msg:566945
 9:31 pm on Dec 8, 2004 (gmt 0)

Another twist to the problem.

As mention in a previous post there are twenty anchor links list in the navigation page. All of them are generated using PHP (#sec[$i]).

On one page there were only three anchor links in the navigation page (not including the link to the top of the page.) When they are hard coded as in: #reviews - #comments - #emails, they did not work in IE. However, when converted to the PHP system of (#sec[$i]) they do.

Nothing changes except for the name and id of the anchor links and in one case it will work in IE and in the other it won't. Both do work in FF however.

Obviously, there is an IE quirk at work here and if anyone has a clue to why it would make a difference to generate the links dynamically would mean success, please clue me in.

rocknbil




msg:566946
 12:52 am on Dec 9, 2004 (gmt 0)

I didn't advise it. I asked you if you had TRIED it.

Sometime set up a series of mouseover images and name one of the image objects "search", as in img name="search". Your mouseovers on that ONE OBJECT won't work until you change it to srch or searcha or something else. I never found out why, but it's something to know.

The name "top" is used to reference a browser window object and may very well be interferring with your links.

It certainly wouldn't hurt to try. I use "theTop".

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved