Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

document.all

Status
Not open for further replies.

grega

Programmer
Feb 2, 2000
932
GB
I've never given this much thought before, but now I'm wondering ... what exactly does document.all refer to?

I'm looking at a page with a bit of script which says (as an example) ...
Code:
if (!document.all) document.write("Hello")
else clock.innerHTML="Hello"
... where clock is just the name of a DIV section.

I know you can use document.all to navigate through the document tree, but what does it mean in the context above (i.e. returning a boolean value it seems!). Does it return TRUE if all objects on the document have finished loading?

A simple one but I'd like to know.

Greg.
 
i think browsers supporting document.all will return TRUE whereas those NOT supporting it will return false - maybe you're right with the end of loading one, now i'm wondering .... well i've always used it as a "browser detector" (just like : if (!document.print()) alert("please use the menu ....") else document.print()...)
 
i think browsers supporting document.all will return TRUE whereas those NOT supporting it will return false

Now I look at it again ... I think you're right ... probably a browser detector.

Thanks :)

Greg.
 
you're welcome ... but still, i'm wondering about this "loading detector" ... if someone has any info on it, yes i'd like to know !!!!!
 
What it looks like is that it is asking if document.all contains anything (or, since it is using NOT, contains nothing). If the document contains nothing, write "hello", otherwise change the code in the DIV. This makes sense because if you use the write you may overwrite what is already in the document.

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
I'm not totally following this thread, but I know...

if(document.all){

has kept me from getting the dreaded Object Expected error... %-) OK, Who stopped payment on my reality check?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top