image onload javascript code example
Example 1: on load javascript
window.onload = (event) => {
console.log('page is fully loaded');
};
Example 2: javascript on image load
window.onload = function () {
var logo = document.getElementById('sologo');
logo.onload = function () {
alert ("The image has loaded!");
};
setTimeout(function(){
logo.src = 'https://edmullen.net/test/rc.jpg';
}, 5000);
};