Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

load js

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

window.addEventListener('load', (event) => {
  console.log('page is fully loaded');
});
Comment

load js

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

window.onload = (event) => {
  console.log('page is fully loaded');
};
Comment

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
';
});

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

document.addEventListener('DOMContentLoaded', (event) => {
    log.textContent = log.textContent + `DOMContentLoaded
`;
});

Comment

PREVIOUS NEXT
Code Example
Javascript :: promise javascript 
Javascript :: trim text 
Javascript :: array map order by timestamp reactjs 
Javascript :: javascript dom after a element 
Javascript :: inline null check javascript 
Javascript :: basics of switch case and if else 
Javascript :: handle bar 
Javascript :: solcjs 
Javascript :: change app name in react native android 
Javascript :: Real image width with JavaScript 
Javascript :: pass element from child to parent react 
Javascript :: jquery send to another page 
Javascript :: Get Parameters Of URL As A String 
Javascript :: Angle Between Hands of a Clock 
Javascript :: sweetalert2 small icon 
Javascript :: sintax arrow function in javascript 
Javascript :: javascript call stacks 
Javascript :: react native radio buttons 
Javascript :: javascript settimeout lambda function 
Javascript :: react to pdf 
Javascript :: reduce in javascript 
Javascript :: angular reference element 
Javascript :: useref example 
Javascript :: javascript remove element from array in foreach 
Javascript :: react-select-search useSelect hook 
Javascript :: json web token flask 
Javascript :: how to print json.stringify of nested objects 
Javascript :: polymorphism javascript 
Javascript :: trigger keydown event javascript 
Javascript :: json parameter name javascript 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =