Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. function ready(callback){
  2. if (document.readyState != 'loading') callback();
  3.  
  4. else if (documento.addEventListener)
  5. document.addEventListener('DOMContentLoaded', callback);
  6.  
  7. else document.attachEvent('onreadystatechange', function(){
  8. if (document.readyState == 'complete') callback();
  9. })
  10. }
  11.  
  12. ready( function(){
  13. // Your code is here...
  14. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement