Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- // 'load' events should be supported by every browser
- // this was just an exercise to find a way to test it
- var isLoadSupported = 'onload' in window, loadHandler = window.onload;
- document.createElement('body').setAttribute('onload', 'return');
- isLoadSupported = isLoadSupported || typeof window.onload == 'function';
- window.onload = loadHandler;
- window.addEventListener('DOMContentLoaded', function(e) {
- alert(e.type + " - " + isLoadSupported);
- }, false);
- window.addEventListener('load', function(e) {
- alert(e.type + " - " + isLoadSupported);
- }, false);
- </script>
Add Comment
Please, Sign In to add comment