Can certain browser's ignore the menu?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
tepidarium
Mega User
Mega User
Posts: 169
Joined: Sun Oct 05, 2003 4:21 am

Can certain browser's ignore the menu?

Post by tepidarium »

Is it possible to have certain browsers ignore the milonic menu and display the page without the menu loaded (i.e. Netscape 4, older versions of IE?)
User avatar
timrivera
Super Advanced
Super Advanced
Posts: 31
Joined: Sun Jan 04, 2004 8:21 pm
Location: Metro-Atlanta, Georgia, USA
Contact:

Re: Can certain browser's ignore the menu?

Post by timrivera »

tepidarium wrote:Is it possible to have certain browsers ignore the milonic menu and display the page without the menu loaded (i.e. Netscape 4, older versions of IE?)
As for NN4, just remove the NS4 script, as explained in the menu FAQ:

"I have no need to support Netscape 4, can I remove the reference to it?"
http://milonic.com/menufaq.php#nonavi4


As for IE, thought about conditional comments, but I couldn't figure out a good way to use them. You could use conditional comments to have the script given only in IE5+, but that leaves out the other browsers such as Opera and Mozilla. You could use conditional comments to insert a pair of some sort of HTML tags (i.e. <noscript>) for older versions of IE to prevent the scripts from being rendered, but that would be invalid markup if you have the scripts in the HEAD section.


Tim
tepidarium
Mega User
Mega User
Posts: 169
Joined: Sun Oct 05, 2003 4:21 am

Post by tepidarium »

I have tried this method as described in the FAQ, but it does not cause netscape to ignore the menu. Netscape4 simply doesn't load the page.

I am wondering if there is a way to just have netscape ignore the code and actually load the page without the menu code causing it to mess up.

The code, if one chooses to "not support" Netscape4 would then be? :

Code: Select all

<script language=JavaScript src="milonic_src.js" type=text/javascript></script>
<script language=JavaScript src="mmenudom.js" type=text/javascript></script>
<script language=JavaScript src="menu_data.js" type=text/javascript></script>
[/url]
User avatar
timrivera
Super Advanced
Super Advanced
Posts: 31
Joined: Sun Jan 04, 2004 8:21 pm
Location: Metro-Atlanta, Georgia, USA
Contact:

Post by timrivera »

tepidarium wrote:I have tried this method as described in the FAQ, but it does not cause netscape to ignore the menu. Netscape4 simply doesn't load the page.
You are right. I just tried using NN4.8, and the main menu loads but nothing else on the page. I received these errors:

JavaScript Error: milonic_src.js, line 16:
_$S is not defined.

JavaScript Error: mmenudom.js, line 16:
ie55 is not defined.

JavaScript Error: mmenudom.js, line 16:
ie55 is not defined.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

seems like what is needed is some code to call say version 3..which isn't supported, let me say, if it's netscape4....ver3 worked pretty good in that browser, but don't ask what that would be, I wouldn't know a code if it slapped me in the face...well, I might know it was code but no idea what it was doing... :lol: But, is there something in the other files that somehow mess up if the mmenuns4.js isn't there? Hopefully, ya'll know what i'm trying to say....
Ruth
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

If you are savvy enough you can take a look in milonic_src. There you will see extensive browser testing code and see there are a number of variables set based on what browser is detected. You can use these variables to your advantage and decide whether or not to load the menu_data file or not.

In fact, as you'll know the basic code to load the menu scripts has the if(ns4) in it to decide whether or not to load mmenuns4 or mmenudom correct? Well surround your loading of the menu_data file with a similar if statement, if( !ns4) , and it will only load the menu_data file only if it DOES NOT detect ns4.

And the reason you get errors is because functions and variables are actually defined in the mmenuXXX files. And if you just remove them then when menu_data calls on things that dont exist, you get errors.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
Post Reply