I have a problem accessing the \'event\' in Firefox. The following code works fine in Chrome, but in Firefox I get a \"event is not defined\" error.
-
Try this instead:
function rowSelected(event, type) {
var eventRow = event.currentTarget; // here I get the error
}
You where not allowing the event argument to be passed. Well, you were but it was being passed into the type variable. Now event
will contain the currentTarget
value.
EDIT
Oh wait! You wish to pass the row type too.
This should do it!
<tr onclick="rowSelected(event, 'thisRowType')">
... row content ...
</tr>
<script type="text/javascript">
function rowSelected(event, type) {
var eventRow = event.currentTarget; // here I get the error
alert(type);
}
</script>
讨论(0)
- 热议问题