Welcome to WebmasterWorld Guest from 54.167.175.107

Forum Moderators: incrediBILL

IFRAMES and NS4

shortest sniffer code

   
9:12 pm on Mar 6, 2001 (gmt 0)

WebmasterWorld Senior Member rcjordan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



With the roll-out of NS6, IFRAMES will rapidly overtake LAYERS and ILAYERS for handling some cross-browser coding, but we may have a legacy issue with NS4 browsers for some time to come. Does anyone have the js code for sniffing NS4 only, with everything else being the default?
9:31 pm on Mar 6, 2001 (gmt 0)

10+ Year Member



I think you can just do
If (document.layers){

}
I am sure there is another way

9:35 pm on Mar 6, 2001 (gmt 0)

WebmasterWorld Senior Member rcjordan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Thanks David, I should have added:

I'm going to inject banner rotation using ILAYERS into pages being served to NS4, everything else gets an IFRAME. I'm currently testing for every browser under the sun and no longer see the need. I could drop 20k or more of js by just testing for NS4.

9:45 pm on Mar 6, 2001 (gmt 0)

10+ Year Member



I am grabbing this from memory but as long as the "document.layers" is correct it will return true only on NS4
so...
If (document.layers){
call to function ILAYER
}
else {
call to function IFRAME
}

Just tested it, should work.
8:45 pm on Mar 7, 2001 (gmt 0)

10+ Year Member



Why are you testing at all? Why not just wrap an ILAYER around an IFRAME the way DoubleClick does?
10:13 pm on Mar 7, 2001 (gmt 0)

WebmasterWorld Senior Member rcjordan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



>wrap iframe in ilayer

Seems to me I tried that once at it blew up, but that may have been because of NS3 legacy problems.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month