javascript code not working properly on mozilla

VERIFIED INVALID

Status

()

VERIFIED INVALID
17 years ago
17 years ago

People

(Reporter: bmpc, Assigned: rogerl)

Tracking

Trunk
x86
Windows 98
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
<script type="text/javascript">
      function select(obj) {
        obj.style.borderColor = "#cccccc";
      }
      
      function deselect (obj) {
        obj.style.borderColor = "#ffffff";
      }
      
      function goto (url) {
        location = url;
      }
    </script>


<td onmouseover="select(this);" onmouseout="deselect(this);"
onmouseclick="goto('aaa.php');" align="center" style="cursor: hand; width: 70px;
border: 1px solid #ffffff;">destaques</td>


Works fine in MSIE.

--- ERRORS:


Error: select is not defined

Error: deselect is not defined
(Reporter)

Comment 1

17 years ago
It's working now.


 <script type="text/javascript">
select = function (obj) {
        obj.style.borderColor = "#cccccc";
        
        obj.style.cursor = "hand";
        if (!obj.style.cursor) {
          obj.style.cursor = "pointer";
        }
      }
      
      deselect = function (obj) {
        obj.style.borderColor = "#ffffff";
      }
      
      jump = function (url) {
        window.location = url;
      }
    </script>

Comment 2

17 years ago
This bug is invalid.  The identifier "goto" is a javascript reserved word, and
causes the problem script to abort due to the associated syntax errors.

Comment 3

17 years ago
Steven is correct; see the language specification Section 7.5.3,
"Future Reserved Words" in the ECMA-262 3rd Edition Final spec:

at            http://www.mozilla.org/js/language/

                                                                             
bmpc: I know you realized this already in your Comment #1 above.
Thank you for using Bugzilla and Mozilla - 
Status: UNCONFIRMED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → INVALID

Comment 4

17 years ago
Marking Verified -
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.