code: function alReady ( fn ) {
          var add = 'addEventListener';
          var pre = document[ add ] ? '' : 'on';
  
          ~document.readyState.indexOf( 'm' ) ? fn() :
              'load DOMContentLoaded readystatechange'.replace( /\w+/g, function( type, i ) {
                  ( i ? document : window )
                      [ pre ? 'attachEvent' : add ]
                  (
                      pre + type,
                      function(){ if ( fn ) if ( i < 6 || ~document.readyState.indexOf( 'm' ) ) fn(), fn = 0 },
                      !1
                  )
              })
      }
docs: Dom ready.
  
  @param {Function} fn
  
  @link https://github.com/jed/alReady.js