Az Expattech az ünnepek alatt (dec.24-jan.1.) zárva tart. Nyitás: 2024.január 2

ExpatTech Techblog

Nagy Richárd 2009.03.30. 16:16

Global Javascript Events

If you want to catch ex. every mouseclick on the whole page, you should attach the event to document.body. This will work with both Firefox (addEventListener) and IE (attachEvent).

If you want to attach the onload event globally (fires when the page is loaded), you can attach it to window.