Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

e has no Properties error in FireFox

Avatar of bcaff86
bcaff86 asked on
Web Languages and StandardsJavaScriptWeb Browsers
2 Comments1 Solution320 ViewsLast Modified:
II am trying to capture ctrl and shift clicks via javascript.

The code below works great in IE and Safari but not in Firefox.  In FF I get e has no properties.

How can I get this to work across all 3 IE, Safari and FF?  
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <script type="text/javascript">
    function SelectRow(row_id)
    {
        if(!e) var e = window.event;
        var row = document.getElementById(row_id);
        alert(row.rowIndex);
         
         if(e.ctrlKey != true && e.shiftKey != true)
         {
            alert('here');
         }
    }
    </script>
    
    
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table border="1">
    <tr id="r1" onclick="SelectRow(this.id);"><td>1</td><td>abc</td></tr>
    <tr id="r2" onclick="SelectRow(this.id);"><td>1</td><td>abc</td></tr>
    <tr id="r3" onclick="SelectRow(this.id);"><td>1</td><td>abc</td></tr>
    </table>
    </div>
    </form>
</body>
</html>
ASKER CERTIFIED SOLUTION
Avatar of Albert Van Halen
Albert Van HalenFlag of Netherlands imageAnalyst developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answers