Client Side Include file not working with Firefox

Discussion in 'HTML' started by Mike Azzopardi, Apr 3, 2006.

  1. Hi All

    I'm hoping someone can help with this problem I've found. I have a Gif Menu
    with links as an image map. I wish to use a client side include file on my
    pages so I can update the menu once, and it reflects on all the pages on the
    site.

    This calls myinclude.js (which is on everypage) that needs the menu:
    <SCRIPT LANGUAGE="JavaScript" type="text/javascript"
    src="myInclude.js"></SCRIPT>

    myInclude.js (basically a table row with the image and image map):
    document.write('<table width="100%" height="2%" border=0 align="center"
    cellpadding=0 cellspacing=0 bordercolor="#FFFFFF" hspace="2">'
    + ' <tr> '
    + ' <td height="20" bgcolor=#000066> '
    + ' <div align="center" class="style1"><strong><font color="#FFFFFF"
    size="4" face="Courier New, Courier, mono"><img src="menunew.GIF"
    width="776" height="21" border="0" usemap="#Map"></font></strong> '
    + ' <map name="Map">'
    + ' <map name="Map"><area shape="rect" coords="2,3,60,18"
    href="index.html">'
    + ' <area shape="rect" coords="85,3,167,20" href="artists.htm">'
    + ' <area shape="rect" coords="193,3,326,20" href="project.htm">'
    + ' <area shape="rect" coords="345,3,436,20" href="form/index.htm">'
    + ' <area shape="rect" coords="457,3,574,20" href="http://www.heifer.org"
    target="_blank">'
    + ' <area shape="rect" coords="598,3,689,20" href="contact.htm">'
    + ' <area shape="rect" coords="712,3,772,20" href="links.htm">'
    + ' </map>'
    + ' </div></td>'
    + ' </tr>'
    + ' <tbody>'
    + ' </tbody>'
    + '</table>');

    This all works fine with IE. With Firefox, just the image displays
    correctly - the links do not appear as active.

    Any ideas appreciated.

    Mike
     
    Mike Azzopardi, Apr 3, 2006
    #1
    1. Advertising

  2. Mike Azzopardi

    Jim Moe Guest

    Mike Azzopardi wrote:
    >
    > I'm hoping someone can help with this problem I've found. I have a Gif Menu
    > with links as an image map. I wish to use a client side include file on my
    > pages so I can update the menu once, and it reflects on all the pages on the
    > site.
    >

    What if the visitor has Javascript disabled?

    > This calls myinclude.js (which is on everypage) that needs the menu:
    > <SCRIPT LANGUAGE="JavaScript" type="text/javascript"
    > src="myInclude.js"></SCRIPT>
    >
    > [...]
    > This all works fine with IE. With Firefox, just the image displays
    > correctly - the links do not appear as active.
    >

    Does FF's javascript console show any errors?

    --
    jmm (hyphen) list (at) sohnen-moe (dot) com
    (Remove .AXSPAMGN for email)
     
    Jim Moe, Apr 3, 2006
    #2
    1. Advertising

  3. Mike Azzopardi

    Guest


    > What if the visitor has Javascript disabled?


    I didn't think of that - Is there a better way to have a menu, so that
    you can change it in one place and have it change on the 100 other
    pages? I'd like to use an image if possible

    > Does FF's javascript console show any errors?


    Nope, console is clear. Here is a test page to show the behaviour:

    http://fjam.zapto.org/charity/testlinks.htm


    Thanks
    Mike
     
    , Apr 3, 2006
    #3
  4. Mike Azzopardi

    BootNic Guest

    > "Mike Azzopardi" <> wrote:
    > news:C4dYf.4881$....
    >

    [snip]
    > + ' <map name="Map">'
    > + ' <map name="Map">

    [snip]
    >
    > This all works fine with IE. With Firefox, just the image displays
    > correctly - the links do not appear as active.


    It may work better if you remove the extra <map name="Map">

    --
    BootNic Monday, April 03, 2006 4:18 PM

    You can turn painful situations around through laughter. If you can
    find humor in anything - even poverty - you can survive it.
    *Bill Cosby*
     
    BootNic, Apr 3, 2006
    #4
  5. It may work better if you remove the extra <map name="Map">

    Yep thats it :). Well spotted.

    Thanks for the help
    Mike
     
    Mike Azzopardi, Apr 3, 2006
    #5
  6. Gazing into my crystal ball I observed writing in
    news::

    >> What if the visitor has Javascript disabled?

    >
    > I didn't think of that - Is there a better way to have a menu, so that
    > you can change it in one place and have it change on the 100 other
    > pages? I'd like to use an image if possible
    >
    >


    http://allmyfaqs.net/faq.pl?Include_one_file_in_another

    --
    Adrienne Boswell
    Please respond to the group so others can share
    http://www.cavalcade-of-coding.info
     
    Adrienne Boswell, Apr 4, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alan Silver
    Replies:
    1
    Views:
    3,792
    Alan Silver
    Aug 2, 2005
  2. Boss302
    Replies:
    0
    Views:
    1,070
    Boss302
    Nov 21, 2006
  3. Andreas Bogenberger
    Replies:
    3
    Views:
    959
    Andreas Bogenberger
    Feb 22, 2008
  4. Bogdan
    Replies:
    2
    Views:
    668
    Bogdan
    Jun 9, 2008
  5. Zoe Hart
    Replies:
    1
    Views:
    383
    Scott Wisniewski
    Jan 8, 2004
Loading...

Share This Page