YUI - Determine when the DOM is ready to be used


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <script type="text/javascript">
  2. // Remember to include: .../build/yahoo-dom-event/yahoo-dom-event.js
  3. YAHOO.example.init = function()
  4. {
  5. // Init stuff Here
  6. var myAutoComp = new YAHOO.widget.AutoComplete("myInput","myContainer", myDataSource);
  7. };
  8. YAHOO.util.Event.onDOMReady(YAHOO.example.init);
  9. </script>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.