NS4 browser check happens too late

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
stein
Advanced
Advanced
Posts: 12
Joined: Mon Apr 19, 2004 9:02 pm
Location: Juneau, Alaska
Contact:

NS4 browser check happens too late

Post by stein »

http://www.akdemocrats.org -- my site

I modified my header to either: load a simple banner graphic for NS4 -or- load a SWF flash animation for NS6 + IE.

Code: Select all

<SCRIPT language=JavaScript src="/menu/milonic_src.js" type=text/javascript></SCRIPT>
<script language=JavaScript>
if (parent.frames.length) { top.location=document.location;}
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=/menu/mmenuns4.js></scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=/menu/mmenudom.js></scr"+"ipt>");
if(ns4)_d.write("<a href="http://websites.milonic.com/akdemocrats.org><img src=http://www.akdemocrats.org/images/Banner_GIF_white.gif width=760 height=100 border=0></a><br>");
else _d.write("<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0 width=760 height=100><param name=movie value=../images/Banners/banner4.swf><param name=quality value=high><embed src=../images/Banners/banner4.swf quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash width=760 height=100></embed></object>");
</script>
<SCRIPT language=JavaScript src="/menu/menu_data.js" type=text/javascript></SCRIPT>
I get weird results when I include the HTML code in the initial if(ns4)_d.write tag - like the graphic showing up in the middle of the page...

I have been noticing with some frustration that I can dump all files in my cache for NS 4.79, have no memory or disk set for caching and then browse to my website with NS and it will download ALL the .js files as well as the .swf file TO MY CACHE folder before displaying the Flash Animation and failing to display the menu (fresh load). Clicking Reload will cause the correct banner graphic to show and the menu itself finally appears.

I don't really have to conquer this, but I was hoping to avoid having NS4.79 users from having to be burdened by the downloads if they aren't supposed to see it.

Any ideas how to make the NS4 check occur before NS spoils itself on data meant for the more grown up browsers?
'Montani Semper Liberii'
Post Reply