Last active
December 15, 2015 09:58
-
-
Save sudodoki/5241839 to your computer and use it in GitHub Desktop.
JavaScript window.onload chaining
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(-> | |
# As seen on http://snipplr.com/view/52589/javascript-windowonload-chaining/ | |
# Backup previous onload method. | |
previous_onload = window.onload | |
window.onload = -> | |
try # Execute. Ignore if error. | |
previous_onload() | |
# Your code goes here | |
console.log "Running Code..." | |
)() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment