loaded page js code example
Example 1: dom is loaded
document.addEventListener('DOMContentLoaded', (event) => {
console.log('DOM fully loaded and parsed');
});
Example 2: javascript load page
window.location = "https://example.com/";
document.addEventListener('DOMContentLoaded', (event) => {
console.log('DOM fully loaded and parsed');
});
window.location = "https://example.com/";