Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FireFox events

Status
Not open for further replies.

stormbind

Technical User
Mar 6, 2003
1,165
0
0
GB
Code:
   window.onload = function() {
       window.addEventListener('click', function() { testClick(event) }, false);
       window.addEventListener('mouseover', function() { testMove(event) }, false);
   }

The above works in Chrome, Opera and IE. It does not work in FF.

I think FF supports the keyword 'event' in a tag such <body onclick="testClick(event)" /> and not in the quoted code.

How do I fix the JS for all browsers?

Thanks,

--Glen :)
 
Hi

Remove those pointless anonymous functions :
JavaScript:
window[teal].[/teal]onload [teal]=[/teal] [b]function[/b][teal]()[/teal] [teal]{[/teal]
  window[teal].[/teal][COLOR=darkgoldenrod]addEventListener[/color][teal]([/teal][green][i]'click'[/i][/green][teal],[/teal] testClick[teal],[/teal] [b]false[/b][teal]);[/teal]
  window[teal].[/teal][COLOR=darkgoldenrod]addEventListener[/color][teal]([/teal][green][i]'mouseover'[/i][/green][teal],[/teal] testMove[teal],[/teal] [b]false[/b][teal]);[/teal]
[teal]}[/teal]


Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top