Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what browser is document.layers sniffing?

I am looking at some JS code from the 20th century, and they are using document.layers in code that is trying to get the current key code. What browser are they sniffing for?

i am about to replace the code with something like this:

var fn = function(event){
  event = event || window.event;
  var code = event.charCode || event.keyCode;
}

but i am afraid of breaking something arcane and releasing the evil

like image 896
mkoryak Avatar asked Jan 13 '10 20:01

mkoryak


2 Answers

document.layers exists in Netscape 4 and holds all <layer> and <ilayer> elements.
It was an early precursor to true DHTML.

For more information, see here. (Ten years old)

like image 55
SLaks Avatar answered Nov 05 '22 00:11

SLaks


Netscape 4 is not able to display any modern web-page due to it's total lack of CSS support - so if you drop the support for this browser then you are not breaking anything that isnt already broken.

like image 21
Andris Avatar answered Nov 05 '22 00:11

Andris