Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function domready(callback) {
- if (document.readyState === "loading"){
- document.addEventListener('DOMContentLoaded', callback);
- } else {
- callback();
- }
- }
- domready(function() {
- // the dom is guaranteed to be loaded here
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement