Welcome to WebmasterWorld Guest from 54.196.232.162

Forum Moderators: incrediBILL

Message Too Old, No Replies

IFRAMES and NS4

shortest sniffer code

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

Senior Member

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

joined:Apr 22, 2000
posts:9138
votes: 0


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)

Preferred Member

10+ Year Member

joined:Oct 26, 2000
posts:414
votes: 0


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)

Senior Member

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

joined:Apr 22, 2000
posts:9138
votes: 0


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)

Preferred Member

10+ Year Member

joined:Oct 26, 2000
posts:414
votes: 0


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)

Full Member

10+ Year Member

joined:Oct 18, 2000
posts:256
votes: 0


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)

Senior Member

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

joined:Apr 22, 2000
posts:9138
votes: 0


>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.