Skip to content

Instantly share code, notes, and snippets.

@jasonLaster
Created September 6, 2012 16:19
Show Gist options
  • Save jasonLaster/3658063 to your computer and use it in GitHub Desktop.
Save jasonLaster/3658063 to your computer and use it in GitHub Desktop.
Check to see when js has been loaded

It's possible to use the standard onload event for some dom element.

<element onload="SomeJavaScriptCode">

<body>, <frame>, <frameset>, <iframe>, <img>, <input type="image">, <link>, <script>, <style>

It's possible to programmatically add an onload eventlistener to several objects in JS.

object.onload="SomeJavaScriptCode"

Document, Window, XMLDocument, XMLHttpRequest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment