Click here to Skip to main content
13,045,564 members (72,074 online)
Rate this:
Please Sign up or sign in to vote.
I have a problem using JavaScript that seems to function properly in IE but not in Mozilla Firefox..

Following is a simple example for that kind of JavaScript code:

    <title>Helo World</title>
        <script type='text/javascript'>
            function ShowSelection() {
            alert('Your selection is ' + SelectColor.value);
   = SelectColor.value;
            catch(e){alert('An error has occurred: '+e.message)}
    <div id="BodyContent">
        <hr />
         Select a color theme:
        <select id="SelectColor">
            <option value="white">White</option>
            <option value="yellow">Yellow</option>
            <option value="silver">Silver</option>
        <input id="SelectionBTN" type="button" value="Select" onclick="ShowSelection()"  />
     br mode="hold" />  </div>

You can try this and you can see EVERYTHING WORKS FINE WITH IE, but NOT with Mozilla Firefox. In Firefox it gives an error that saying "function is not defined". Why? How to fix it??
Posted 17-Mar-11 8:53am
AlbinAbel 17-Mar-11 15:17pm
Which version of firebox it is?. if it is older version then you may need to use the document.getElementById method

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Since you are having a problem with FF, are you familier with firebug[^]? If not why not get it and debug it yourself. It is a great javascript debugging tool, I am sure you will like it.
Espen Harlinn 17-Mar-11 19:34pm
Good advice, my 5
Yusuf 18-Mar-11 8:45am
Thanks, Firebug is simply amazing

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 17 Mar 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100