1234567891011121314 |
- <script>
- const runWhenDOMLoaded = cb => {
- if (document.readyState != 'loading') {
- cb()
- } else if (document.addEventListener) {
- document.addEventListener('DOMContentLoaded', cb)
- } else {
- document.attachEvent('onreadystatechange', function() {
- if (document.readyState == 'complete') cb()
- })
- }
- }
- </script>
|