Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.
Hi all, please see this major site announcement: https://www.boards.ie/discussion/2058427594/boards-ie-2026

JAVASCRIPT not working in Firefox

  • 11-01-2007 02:39PM
    #1
    Closed Accounts Posts: 46


    I cant figure out where Im going wrong here, this works fine in IE but does nothing in firefox. I have a web page where I am changing the content on <div> when someone clicks on a certain button. I am doing this using the following:

    <script type="text/javascript">
    t1="Test 1"
    t2="<p>Test 2</p>"
    t3="<p>Test 3</p>"
    t4="<p>Test 4</p>"
    t5="<p>Test 5</p>"
    </script>

    I am calling this in the Menu div so that the div called content changes depending on which button the user prosses:
    <div id="menu">
    <h2><span>Menu</span></h2>
    <ul>
    <img onClick="history.go(0)" src="welcom.gif">
    <br><img onclick=content.innerHTML=t1 src="oneD.gif">
    <br><img onclick=content.innerHTML=t2 src="fts.gif">
    <br><img onclick=content.innerHTML=t3 src="atm.gif">
    <br><img onclick=content.innerHTML=t4 src="cdd.gif">
    <br><img onclick=content.innerHTML=t5 src="tools.gif">
    </ul>
    </div>

    Why wouldnt this work in Firefox when IE handles it perfectly?


Comments

  • Registered Users, Registered Users 2 Posts: 7,299 ✭✭✭kenmc


    Maybe you have a script blocker which prevents Java/Script from running?


  • Closed Accounts Posts: 46 kat9182


    I dont think so as other sites taht use javascript appear fine, but how do I check?


  • Registered Users, Registered Users 2 Posts: 7,468 ✭✭✭Evil Phil


    Can you post the entire html for the page?


  • Registered Users, Registered Users 2 Posts: 37,485 ✭✭✭✭Khannie


    Try typing

    javascipt:

    in the address bar to bring up the warn / error information. IE can be more fault tolerant than Firefox at times.


  • Closed Accounts Posts: 46 kat9182


    Thanks for the help guys...

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
    <html xmlns="http://www.w3.org/1999/xhtml&quot; xml:lang="en" lang="en-gb">

    <head>
    <meta http-equiv="content-type" content="text/html;charset=iso-8859-1"/>
    <style type="text/css" media="screen">@import url(http://static.weddingpath.com/paths/templates/websiteSchemes/peterong/silkandpaper/style.css);</style&gt;


    <title>Test</title>

    <script type="text/javascript" src="http://static.weddingpath.com/paths/assets/textarea.js"></script&gt;

    <script language="JavaScript" src="http://static.weddingpath.com/paths/assets/validator.js"></script&gt;
    <script language="JavaScript" src="http://static.weddingpath.com/paths/assets/framebreaker.js&quot; type="text/javascript"></script>


    <script type="text/javascript">
    t1="<table><form action='Addrsvp.php' method='post'><tr><td align='right' class='body' width='60'>Name:</td><td class='body' width='350'><input type='text' name='name' size='30' maxlength='50' value='' class='entry' /></td></tr><tr><td colspan='2' class='subhead'>Will you be attending?</td></tr><tr><td colspan='2' class='body'><label for='yesno1'> <input type='radio' name='yesno' value='YES' id='yesno1' checked /> Yes, we will be attending.</label></td></tr><tr><td></td><td class='body'><select name='attendees' class='select'><option value='0' >0</option><option value='1' selected>1</option><option value='2' >2</option><option value='3' >3</option><option value='4' >4</option></select>Number of Attendees</td></tr><tr><td colspan='2' class='body'><label for='yesno0'> <input type='radio' name='yesno' value='NO' id='yesno0' /> No, we will not be attending.</label></td></tr><tr><td colspan='2' class='subhead'>Do you have any special requirements?</td></tr><tr><td colspan='2'><textarea cols='37' rows='3' name='special' class='entry'></textarea></td></tr><tr><td colspan='2' class='body'>Please enter any additional comments below.</td></tr><tr><td colspan='2'><textarea cols='43' rows='4' name='comments' class='entry'></textarea></td></tr><tr><td colspan='2' height='4'></td></tr><tr><td colspan='2'><input type='button' value='RSVP'></td></tr></form></table>"
    t2="<p>Flights</p>"
    t3="<p>Accom</p>"
    t4="<p>Church</p>"
    t5="<p>To Do</p>"
    </script>


    </head>

    <body onload="breakout_of_frame()">
    <div id="container">


    <div id="pageheader">
    <!-- URL's used in the movie-->
    <!-- text used in the movie-->
    <!-- -->
    <OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0&quot;
    WIDTH="690" HEIGHT="140" id="wedhead" ALIGN="">
    <PARAM NAME=movie VALUE="http://static.weddingpath.com/paths/templates/websiteSchemes/peterong/silkandpaper/media/wedhead.swf?toshow=Top_*_Image&tcolour=888888&tsize=34&toff=0"&gt;
    <PARAM NAME=menu VALUE=false>
    <PARAM NAME=quality VALUE=high>
    <PARAM NAME=scale VALUE=noscale>
    <PARAM NAME=bgcolor VALUE=#FFFFFF>

    </OBJECT>

    </div>

    <div id="menu">
    <h2><span>Menu</span></h2>
    <ul>


    <img onClick="history.go(0)" src="welcom.gif">
    <br><img onclick=content.innerHTML=t1 src="rsvp.gif">
    <br><img onclick=content.innerHTML=t2 src="flights.gif">

    <br><img onclick=content.innerHTML=t3 src="accom.gif">
    <br><img onclick=content.innerHTML=t4 src="church.gif">
    <br><img onclick=content.innerHTML=t5 src="todo.gif">



    <li><strong style="color: #888888;"></strong></li>

    </ul>



    </div>

    <div id="content">


    <span class="wptext"><img src="http://static.weddingpath.com/paths/templates/websiteSchemes/peterong/silkandpaper/media/Welcome.gif&quot; /><br />

    Example TEXT
    <br><br>
    blah blah blah .<br /></span> </div>

    <div class="clear"></div>


    <div id="footer">
    <div id="datebar">
    <div id="dbLeft">Date: 07 Sep 2007</div>
    <div id="dbRight">Countdown: 245 days</div>

    </div>
    </div>

    <div class="clear"> </div>
    </div>
    <div class="clear"> </div>
    </body>

    </html>


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 32,132 ✭✭✭✭is_that_so


    What does the Firefox error console say ? Tools->Error Console


  • Closed Accounts Posts: 46 kat9182


    I get an error about the CSS that Im linking to but no other errors:

    Error: Expected end of value for property but found ','. Error in parsing value for property 'border'. Declaration dropped.
    Source File: http://static.weddingpath.com/paths/templates/websiteSchemes/peterong/silkandpaper/style.css
    Line: 292

    That wouldnt be causing it would it?
    Thanks


  • Registered Users, Registered Users 2 Posts: 32,132 ✭✭✭✭is_that_so


    No it shouldn't be. I believe it may be down to Firefox's interpretation of Inner.HTML. This link may help you. And the Mozilla comment on it.


Advertisement