# Solved: #top and IE 8 Beta



## jamie1949 (Feb 4, 2007)

Making a floating menu that uses #top and #bot to jump to top and bottom of the page - code works on all browsers but not in Internet Explorer 8 Beta. #bot works but #top doesn't. Anyone know why this is, or better still, find a workaround?

Please - no debate on using IE. :down: People use it, period, and people will be using IE8 so I need my code to handle this.


----------



## Techmonkeys (Feb 10, 2005)

Can we see the page?


----------



## jamie1949 (Feb 4, 2007)

DMcCabe said:


> Can we see the page?


Thanks for your reply. The floating menu is a Java Script routine called in by a command line so I'm not sure what a page will tell you.

Perhaps this better defines the issue:

Simply, if you use #top as an href like this: survival

Clicking on "survival" will take you to the top of the page on all browsers except IE8 Beta.

If you use the command survival This works on IE8 Beta and clicking on "survival" takes you to the bottom of the page.

I would like to know why IE8 does not permit the #top href command.

Regards

Jamie


----------



## TheRobatron (Oct 25, 2007)

Is there an element with the ID #top? If not, try creating a div with a different id like "gototop" (so as to avoid any confusion between browsers) at the top of the page and make the link point there.


----------



## Techmonkeys (Feb 10, 2005)

The reason I asked to see the page is that I dont think they can stop #top working.

Surely it is just an anchor point, that you are calling in a href? so you could call it #bibbidy-boo and place it at the top then as long as your link points to #bibbidy-boo it would still go to the top.


----------



## jamie1949 (Feb 4, 2007)

DMcCabe said:


> The reason I asked to see the page is that I dont think they can stop #top working.
> 
> Surely it is just an anchor point, that you are calling in a href? so you could call it #bibbidy-boo and place it at the top then as long as your link points to #bibbidy-boo it would still go to the top.


I could use a bookmark but never needed to do so before. I have put up a test page:

http://www.survival-expert.com/test_float.html

If you try it, for example, in Firefox the floating compass should take you to the top of the page if you click on North and the bottom of the page if you click on South.

Then try in IE8 Beta

Thanks for your interest,

James


----------



## jamie1949 (Feb 4, 2007)

TheRobatron said:


> Is there an element with the ID #top? If not, try creating a div with a different id like "gototop" (so as to avoid any confusion between browsers) at the top of the page and make the link point there.


Thanks, I'll give that a shot,

James


----------



## amanxman (Mar 28, 2006)

Hey,

If this isn't solved by renaming the ID...


jamie1949 said:


> The floating menu is a Java Script routine called in by a command line so I'm not sure what a page will tell you.


Do the anchors work in IE8 if you hard code them, i.e. simply go to blaa

As oppose to being involved in a JS routine?

Reason I ask is that it would eliminate the JS causing some strange problem if hard coded anchors worked...

Cheers


----------



## amanxman (Mar 28, 2006)

Oh, and also just found this:



> A regression bug has been found in IE8 Beta 1 whereby an anchor link will not work if the anchor doesn't contain a text node.
> 
> Example:
> 
> ...


A workaround if you need text in there, but don't want text in there might be...


```
<a name="broken"/>&nbsp;</a>
```
I.e. just putting a blank space in there...

For example...
  instead of


----------



## jamie1949 (Feb 4, 2007)

amanxman said:


> Hey,
> 
> If this isn't solved by renaming the ID...
> 
> ...


Hi again,

Yes, they work if hard coded, i.e.:

http://www.survival-expert.com/test_float.html

Looks like a problem with JS after all.

Regards


----------



## jamie1949 (Feb 4, 2007)

amanxman said:


> Oh, and also just found this:
> 
> A workaround if you need text in there, but don't want text in there might be...
> 
> ...


Hi,

Yes that works for me. Many thanks for the help,

James


----------

