Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:32
NS4 browser check happens too late
Poster: stein
Dated: Friday April 23 2004 - 0:40:10 BST
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:
<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://www.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>
<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://www.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?