Skip to content

Instantly share code, notes, and snippets.

@gom
Created December 1, 2010 08:36
Show Gist options
  • Save gom/723165 to your computer and use it in GitHub Desktop.
Save gom/723165 to your computer and use it in GitHub Desktop.
<html>
<head>
<title>Event Loaded</title>
</head>
<script type="text/javascript">
function callback(event) {
var res = document.querySelector('#result');
res.innerHTML = res.innerHTML + '<br />' + event.type;
}
window.addEventListener('load', callback);
window.addEventListener('DOMLinkAdded', callback);
window.addEventListener('DOMTitleChanged', callback);
window.addEventListener('DOMContentLoaded', callback);
window.addEventListener('unload', callback);
window.addEventListener('pageshow', callback);
window.addEventListener('pagehide', callback);
</script>
<body>
<div id="result"></div>
<div id="linklist">
<dl>
<dt>event</dt>
<dd>https://developer.mozilla.org/en/DOM/Event</dd>
<dt>Listening to events</dt>
<dd>https://developer.mozilla.org/En/Listening_to_events</dd>
<dt>Gecko Specific DOM Events</dt>
<dd>https://developer.mozilla.org/ja/Gecko-Specific_DOM_Events</dd>
<dt>Gecko DOM Reference</dt>
<dd>https://developer.mozilla.org/ja/Gecko_DOM_Reference</dd>
</dl>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment