Jump to content

[SOLVED] Anchor problem with IE and FF


SkyRanger

Recommended Posts

I am having a problem with IE reading anchors.  I can get it to work in FF but IE7 just doesn't like them.  Has anybody else had this problem if so how can I fix it.

 

Link on one page is:  link.php?id=4#bottom

 

On the link.php page at the bottom it would have <a name="bottom">

 

As I said, works no problem in FF but having problems in IE

Link to post
Share on other sites

I personally like to use id instead of name. This way, you can have your #references pointing to any type of element you like (including divs or header tags, too).

Link to post
Share on other sites

Ok, so instead of using <a name="#bottom">, I would use <div name="#bottom">?

 

No, I recommended using ID instead of NAME:

<div id="bottom"></div>

 

Also, you've got to make sure that you're closing out your elements.

Link to post
Share on other sites

Seriously? Since when did anchors apply to divs?

 

since for ages!

 

I have not used a named anchor for longer than I can remember. Since there was once a point where the name attribute was marked as deprecated (and recinded I beleive as they forgot how they were gonna tackle radio and option groups) in favour of the id attribute.

 

Name has never been a valid attribute for any tag bar anchor and form elements.

Link to post
Share on other sites

Seriously? Since when did anchors apply to divs?

 

since for ages!

 

I have not used a named anchor for longer than I can remember. Since there was once a point where the name attribute was marked as deprecated (and recinded I beleive as they forgot how they were gonna tackle radio and option groups) in favour of the id attribute.

 

Name has never been a valid attribute for any tag bar anchor and form elements.

Name has always been valid for form elements, since HTML 0.9.

Link to post
Share on other sites

All i want to know is why:

 

link.php?id=1#bottom

 

is not working for me in ie7

 

when i use either:

 

echo "<div id=\"bottom\"></div>";
or
echo "<a name=\"bottom\">

 

I also tried on the same page using

 

<a href=\"#bottom\"></a>

 

And that never worked either in IE7

Link to post
Share on other sites

there must be something a miss....

 

<div id="bottom">

...

</div>

 

any link ending in #bottom should scroll to that...

 

try it without any other url vars in the link...(get rid of the id=1 bit)

Link to post
Share on other sites

Ok, checked it in FF, Opera and IE7 and FF IE plugin

 

FF - Works

Opera - Works

IE7 - Doesn't Work

FF IE Plugin - Doesn't work.

 

 

 

I checked a very simple test page in IE7 and it does work.

 

<a href="#anchor">Jump</a>
<P>lorem ipsum
<P>lorem ipsum
<P>lorem ipsum
<P>lorem ipsum
[ enough to make it scroll ..... ]
<a name="anchor"></a>
<h3>The Anchor</h3>

Link to post
Share on other sites

Ok, did a test, got rid of everything, tested the page worked no problem in all browsers

 

 

Tested with:

view.php?oid=146&post_read=1#bottom

 

No such lucky still won't work in IE, anybody have any ideas why?

 

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.