zidanow
zidanow

Reputation: 700

Detecting when a html page finishes loading within an object tag

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

Answers (2)

Łukasz Blaszyński
Łukasz Blaszyński

Reputation: 1565

document.querySelector(".obj_excel").addEventListener('load', () => {
    alert('loded')
})

use above piece of code

Upvotes: 1

Stuart Grant
Stuart Grant

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

Related Questions