/    Sign up×
Community /Pin to ProfileBookmark

Is it possible to find out if a document is done loading?

I’m wondering if it is possible to find out weahter a document has been finnished to load.

For istance:

[code]
if( document.isLoaded )
[/code]

or something.

A DOC method is preferable, but not necessary. Thanks for any help.

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliSep 16.2003 — try using this

<body onload="alert('Document load complete');">
Copy linkTweet thisAlerts:
@EnselicauthorSep 16.2003 — I'd like to get the loading state of an iframe from within the document in where the iframe is, if that is possible.
Copy linkTweet thisAlerts:
@Khalid_AliSep 16.2003 — iframe tag does not have an onload event,what you can do is have the onload body event in the src document that you will load in the iframe and you can access any function,varaible in the src document from the parent page,however, the src page have to be served from the same domain.
Copy linkTweet thisAlerts:
@EnselicauthorSep 16.2003 — That could be a solution I guess.

However, I want things to be clean, so adding an onLoad event in every .htm is not a good way. It becomes unnessecarily complicated if I'm going to add another menuitem.

Maybe I'm too breif, this is the situation...

I have a HTML-doc called menu.htm in which I have several menuitems. There's also an iframe in which I view the selected .htm. Take a look at www.enselic.tk and you'll get it.

I want a single function on the menupage to load and resize the iframe. To know when I'm going to set the size I need to know when the document is fully loaded so scrollHeight is correct.
Copy linkTweet thisAlerts:
@EnselicauthorSep 17.2003 — *bump*

Could someone confirm that it is impossible, please?
×

Success!

Help @Enselic spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...