View Full Version : what does it mean: document.all and document.layers
01-10-2012, 05:17 PM
if(document.layers|| document.getElementById|| document.all)
Could someone give me an idea on why this line would be used in a code?
Thank you very much
01-10-2012, 05:35 PM
That is completely obsolete code.
document.layers identifies Netscape 4.
document.all identifies IE4+. (and Opera)
All modern browsers support document.getElementById
Your code is intended to test whether the browser is IE4 or Netscape 4 or better, as opposed to more ancient (and long obsolete) browsers.
01-10-2012, 05:44 PM
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.