Skip to content

Instantly share code, notes, and snippets.

@sudodoki
Last active December 15, 2015 09:58
Show Gist options
  • Save sudodoki/5241839 to your computer and use it in GitHub Desktop.
Save sudodoki/5241839 to your computer and use it in GitHub Desktop.
JavaScript window.onload chaining
(->
# 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