Answers for "js load method"

2

load js

window.addEventListener('load', (event) => {
  console.log('page is fully loaded');
});
Posted by: Guest on April-08-2020
1

load js

// Log a message when the page is fully loaded:

window.addEventListener('load', (event) => {
  console.log('page is fully loaded');
});
Posted by: Guest on April-08-2020
0

load js

// The same, but using the onload event handler property:

window.onload = (event) => {
  console.log('page is fully loaded');
};
Posted by: Guest on April-08-2020
0

load js

const log = document.querySelector('.event-log-contents');
const reload = document.querySelector('#reload');

reload.addEventListener('click', () => {
  log.textContent ='';
  window.setTimeout(() => {
      window.location.reload(true);
  }, 200);
});

window.addEventListener('load', (event) => {
    log.textContent = log.textContent + 'load\n';
});

document.addEventListener('readystatechange', (event) => {
    log.textContent = log.textContent + `readystate: ${document.readyState}\n`;
});

document.addEventListener('DOMContentLoaded', (event) => {
    log.textContent = log.textContent + `DOMContentLoaded\n`;
});
Posted by: Guest on April-08-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language