views:

21

answers:

1

Hi there

I tried to use windows.location.hash="test.asp#page#section13" and in all browsers it works ok but in IE6 the link in URI is replaced by test.asp#pagesection13.

So it seems IE6 doesn't support multiple anchors. Any way around it (except rewriting everything)?

Yours

Jerry

+1  A: 

There isn't really such a thing as "multiple anchors" though in modern browsers you can use all sorts of characters in an anchor (including #) while in IE6 you cannot. If you don't want to rewrite you might try something like using something like #ie.foo.bar instead of #foo#bar when the visitor is using IE6, detect it on the other side and scroll the element to the top via javascript. (This of course assumes that document.getElementById('foo#bar') fares better, which I haven't tested.)

Tgr
Thanx, if there is not such thing as multiple browsers that it was clearly my mistake in doing so and I'l rewrite and make "/" instead of second "#". Although all new browsers support such thing if it isn't properly by spec, I can not really blame IE6 (this time at least) ;-)
Jerry2
The HTML 4.01 spec [states](http://www.w3.org/TR/html401/types.html#type-name) that *ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".")* (although HTML5 lifts this restriction, I think) so IE is not in the wrong here.
Tgr