Reputation: 700
i'm loading an html page with an object tag, when the page is fully download, i wanna disp something.
I already tried this but this doesn't work.. :
document.querySelector(".obj_excel").onload(function() {
//Do my thing..
});
How can i do it ? thanks you guys
Upvotes: 0
Views: 131
Reputation: 1565
document.querySelector(".obj_excel").addEventListener('load', () => {
alert('loded')
})
use above piece of code
Upvotes: 1
Reputation: 429
The window.onload is the function you want to call to when the window and all it's contents have finished loading.
window.onload = function(){
// do some stuff!
};
Upvotes: 0