My page doesn't work in firefox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bangwazoo
    New Member
    • Oct 2007
    • 2

    My page doesn't work in firefox

    I have made a page, and got it to work in IE, but when i tried to open it in firefox it didnt work. I managed to find out the problem, it goes something like this:

    [CODE=javascript]
    <body onLoad="a();b() ;c()">
    </body>
    <script language="javas cript">
    function a(){
    alert("a")
    }
    function b(){
    alert("b")
    }
    function c(){
    alert("c")
    }
    </script>
    [/CODE]

    if this was my code, i would only get one alert saying "a". I tried putting one function in the onLoad embed, and the other functions in it, i.e.

    [CODE=javascript]<body onLoad="d()">
    </body>
    <script language="javas cript">
    function d(){
    a()
    b()
    c()
    }
    </script>[/CODE]

    however, this did not work either and i still only got one alert.

    any help with this problem would be appreciated.
    Last edited by acoder; Nov 1 '07, 08:22 AM. Reason: fixed code tags
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    #2
    look ..... instead of alerting put some another code then see what happens..

    and one more thing use [code=language] instead of <code>.

    debasis

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Put your JavaScript in the head section rather than after the body.

      Comment

      • bangwazoo
        New Member
        • Oct 2007
        • 2

        #4
        my code wasn't alerting, i put in alerts to test it, and i used them in the example because it was simpler.

        sorry about the code thing, im new to the forum


        ill try putting my javascript in the head, thanks.

        Comment

        • drhowarddrfine
          Recognized Expert Expert
          • Sep 2006
          • 7434

          #5
          Just as a note:
          There is no such thing as <script language="javas cript">

          Change it to:
          <script type="text/javascript">

          Comment

          • itgaurav198
            New Member
            • Oct 2007
            • 41

            #6
            Originally posted by bangwazoo
            I have made a page, and got it to work in IE, but when i tried to open it in firefox it didnt work. I managed to find out the problem, it goes something like this:

            [CODE=javascript]
            <body onLoad="a();b() ;c()">
            </body>
            <script language="javas cript">
            function a(){
            alert("a")
            }
            function b(){
            alert("b")
            }
            function c(){
            alert("c")
            }
            </script>
            [/CODE]

            if this was my code, i would only get one alert saying "a". I tried putting one function in the onLoad embed, and the other functions in it, i.e.

            [CODE=javascript]<body onLoad="d()">
            </body>
            <script language="javas cript">
            function d(){
            a()
            b()
            c()
            }
            </script>[/CODE]

            however, this did not work either and i still only got one alert.

            any help with this problem would be appreciated.
            Hi,

            Your first code is working fine in both IE and Firefox.
            I have run it on my system.

            Thanks

            Comment

            Working...