Is MSIE supposed to reload a web page with <a href="#Tag"> ?

  • Thread starter Thread starter Vince C.
  • Start date Start date
V

Vince C.

Hi.

We are facing a strange problem that occurs with ASP HTML that is viewed in
MSIE6. The HTML has INPUT tags with both "name" and "id" set to the same
value. The ASP is called with arguments, such as:
http://myserver/folder/?arg1=val1&arg2=val2.

In the HTML there is an A tag that refers to an INPUT tag with just the hash
sign and the link name: <a href="#FieldName">...</a>. When the hyperlink is
clicked the whole page is reloaded but as though no arguments were present:
http://myserver/folder/#FieldName which is a completely different thing.

Is this behaviour by design or a bug in MSIE?

Thanks in advance.

Vince C.
 
When the hyperlink is clicked the whole page is reloaded
but as though no arguments were present:
http://myserver/folder/#FieldName which is a completely different thing.

I have seen problems with anchors which have spaces or special
characters in them. Could that be it? The idea would be that if one
aspect of the anchor didn't work for this reason then the same reason
might be responsible for another aspect of it not working properly.

FWIW here is a repost of a reply which expands on that observation.

< repost >
Often the problem is simply that the page has been recoded.
Have you checked the source of the page to see if the anchor name
is still the one that is being given? (Search for something like <a name= )

In fact, it might be useful for you to try a Ctrl-F5 refresh. (E.g. if the
page is being constructed dynamically some of its elements such as
Javascript files might be out of date but the page itself is still being
registered as being current, perhaps by an intermediate cache.)

Otherwise when this happens to me invariably spaces or other
special charactes are used in the anchor. In that case the spaces or
special characters may be represented by their escaped hex string
equivalents (e.g. space would be represented by %20.) For some
reason (perhaps a character set issue) I have had to go into the source
and copy the anchor name out of it, replace what appears to be the
identical anchor name in the Address bar and press Enter. Usually that
is sufficient to make the anchor work. It's a mystery but it doesn't happen
often enough for me to have done any more analysis of it.


HTH

Robert Aldwinckle
 
Robert Aldwinckle said:
I have seen problems with anchors which have spaces or special
characters in them. Could that be it? The idea would be that if one
aspect of the anchor didn't work for this reason then the same reason
might be responsible for another aspect of it not working properly.

FWIW here is a repost of a reply which expands on that observation.

< repost >
Often the problem is simply that the page has been recoded.
Have you checked the source of the page to see if the anchor name
is still the one that is being given? (Search for something like <a name= )

In fact, it might be useful for you to try a Ctrl-F5 refresh. (E.g. if the
page is being constructed dynamically some of its elements such as
Javascript files might be out of date but the page itself is still being
registered as being current, perhaps by an intermediate cache.)

Otherwise when this happens to me invariably spaces or other
special charactes are used in the anchor. In that case the spaces or
special characters may be represented by their escaped hex string
equivalents (e.g. space would be represented by %20.) For some
reason (perhaps a character set issue) I have had to go into the source
and copy the anchor name out of it, replace what appears to be the
identical anchor name in the Address bar and press Enter. Usually that
is sufficient to make the anchor work. It's a mystery but it doesn't happen
often enough for me to have done any more analysis of it. ....
</repost>

Thanks for your response, Robert, but it might not answer my question. The
anchor has no space in it. The anchor refers to a tag in the same "page".

The fact is: if the anchor in the <a href="..."> refers to a tag in the same
"page", then the page is reloaded *without* its initial argument. For
instance:

page url: http://localhost/test/page.asp?myarg=myvalue (note argument
"myarg")

content:
<html>
....
<a name="#MyTag">
....
<a href="#MyTag">
....
</html>

Clicking the link (<a href="#MyTag">) loads:
http://localhost/test/page.asp#MyTag. I think:

1. it should not re-load the page
2. it should not reload the page without arguments
3. it should not reload the page at all
4. it should only scroll until "MyTag" anchor is visible.

Does it make sense?

However I've tried to reproduce that behaviour on my machine (W2K SP4/MSIE
6.01 SP1) and it behaves exactly as I expected...

Vince C.
 
Back
Top