when url dom is ready code example
Example: javascript wait for document load
document.addEventListener("DOMContentLoaded", function(event) {
//do work
});
document.addEventListener("DOMContentLoaded", function(event) {
//do work
});