homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

shortest sniffer code

 9:12 pm on Mar 6, 2001 (gmt 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)

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)

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)

I am grabbing this from memory but as long as the "document.layers" is correct it will return true only on NS4
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)

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)

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

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved