472,125 Members | 1,485 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,125 software developers and data experts.

anchor fails in fire fox

Here's an example of what i'm trying to do.

At www.webpage.com/page1.php, there's a link that points to an anchor at www.webpage.com/page2.php. The syntax is: <a href="page2.php#anchor">Link</a>

Now on page2.php I have that anchor placed inside a header tag. The syntax is: <h2><a name="anchor">Header</a></h2>

The link on page1.php to the anchor on page2.php works just find in IE7. But it doesn't work in firefox. The link takes the browser to page2.php but not down to the anchor.

Now I had this problem a while back ago, and I can't for the life of me remember how to fix it. Any takers? Thanks.
Jul 24 '07 #1
5 3026
7,435 Expert 4TB
Hm. Works for me. .
Jul 24 '07 #2
hmmm--ran the example and it worked for me too.

I took my code apart and determined that if I removed the require('header.php') line from the code, the anchor worked fine. I'm not sure what could be in my header file that would prevent fire fox from searching for and going to the anchor in the webpage.
Jul 25 '07 #3
so setting the display of the div holding the content with the anchor in it to none, then having javascript set the display to default on load will prevent firefox from finding the anchor... are there any workarounds this? i'm guessing it'll take javascript to do so...
Jul 25 '07 #4
7,435 Expert 4TB
Hmm. From what I read this is an issue only with Firefox, however people don't seem to be sure if it's correct behavior or not. You can read this discussion but it might be something you should bring up in the javascript board. Another site claims it is a bug. I'm going to see if it's listed in Bugzilla. I didn't find anything about it in the mozilla forum or the knowledge base which makes me wonder, too, if it's not a bug.
Jul 25 '07 #5
Interesting. I would think, that just because something is set to display:none, firefox would skip it. It's still there, just invisible. Essentially, just because it isn't being displayed, doesn't mean it isn't there.

I think IE7 has the right idea. Although, it makes me wonder what would happen in IE7 if the text was never set back to display:block. Would it just jump down to empty space?
Jul 25 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Patrick | last post: by
10 posts views Thread by elibol | last post: by
16 posts views Thread by Frances | last post: by
8 posts views Thread by knoxautoguy | last post: by
3 posts views Thread by Joseph Gruber | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.