anchor fails in fire fox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Meadock
    New Member
    • Jul 2007
    • 4

    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">H eader</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.
  • drhowarddrfine
    Recognized Expert Expert
    • Sep 2006
    • 7434

    #2
    Hm. Works for me. .

    Comment

    • Meadock
      New Member
      • Jul 2007
      • 4

      #3
      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.

      Comment

      • Meadock
        New Member
        • Jul 2007
        • 4

        #4
        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...

        Comment

        • drhowarddrfine
          Recognized Expert Expert
          • Sep 2006
          • 7434

          #5
          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.

          Comment

          • Meadock
            New Member
            • Jul 2007
            • 4

            #6
            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?

            Comment

            Working...