Can certain browsers be forced to ignore the Menu?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi Kevin. This code has the browser trying to load the file but it stops and gives a javascript error: mmenu.js line 452:
_d.layers[mnu] has no properties. I looked in the file [though I would have no idea what to do about it and it has these lines:

Code: Select all

if(ns4)
{
  mt=_d.layers[mnu].document.layers["el"+(el-1)]
if (!menu[11])  and so on
Ruth
pavia
Super Advanced
Super Advanced
Posts: 39
Joined: Fri Aug 16, 2002 2:39 pm

Post by pavia »

Kevin! Our hero!

Okay, I blew it. I forgot that I had to resort to relatively positioning the menu (placed in a table) so I'm now hung up on how to add the requisite code snippets for the "Place Menu" command for Version 3 and the actual menu items for the first row of the menu for Version 5. Is there a way to incorporate these into one of those cute little if/else thingies?

And, just to complicate things (sorry!), I tried your suggested code and received a javascript error "mt has no properties." Maybe I did something wrong?
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

innkeeper9 wrote:...This code has the browser trying to load the file but it stops and gives a javascript error...
Hi Ruth,

Which example from the code I posted... the first or the second? (I confess to having posted the code without actually tring it first... :oops: )

Kevin
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Pavia,
pavia wrote:...I forgot that I had to resort to relatively positioning the menu (placed in a table) so I'm now hung up on how to add the requisite code snippets for the "Place Menu" command for Version 3 and the actual menu items for the first row of the menu for Version 5. Is there a way to incorporate these into one of those cute little if/else thingies?
I'll have to look into that some...
And, just to complicate things (sorry!), I tried your suggested code and received a javascript error "mt has no properties." Maybe I did something wrong?
Given Ruth's report combined with yours, it's more likely something I may have done wrong. Seems I have some testing to do. I'll get back to this thread a little later...

Kevin
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

I'm sorry Kevin. I meant any of the code you gave here

Code: Select all

<script language="javascript"> 
_NS4 = (document.layers) ? true : false; 
if (_NS4) { 
  document.write("<scr"+"ipt language=JavaScript src=menu_array.js><\/scr"+"ipt>"); 
  document.write("<scr"+"ipt language=JavaScript src=mmenu.js><\/scr"+"ipt>"); 
} 
else { 
  document.write("<scr"+"ipt language=JavaScript src=milonic_src.js><\/scr"+"ipt>"); 
  document.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>"); 
  document.write("<scr"+"ipt language=JavaScript src=menu_data.js><\/scr"+"ipt>"); 
} 
</script>  and then the other one with it split. Having part in the head and part in the body.
I tried:

1. With all the code in the head. Gives the error reference to the mmenu.js
2. Split between head and body. Same error message.
3. Tried just putting the coding you gave for the body to call v3 leaving out the reference to version 5 in the head. I get no error, and if you view source in nn4.79 you can see the coding is there but no menu loads, and I do have all the files in the same folder as the page, I'm doing it on the desktop.

Sorry, I wasn't more specific.

Ruth
pavia
Super Advanced
Super Advanced
Posts: 39
Joined: Fri Aug 16, 2002 2:39 pm

Post by pavia »

Kevin--did you have a chance to look into loading the relatively positioned Version 5 menu for browsers that "work" and the relatively positioned Version 3 menu for crappy Netscape? I feel like a pushy jerk asking for your assistance when you've already gone out of your way to help but I am sort of stuck now.
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Sorry Pavia, I um... well.... forgot about it :oops:

Gotta blaze right now, but I'll give it a shot tomorrow. Wouldn't hurt if you bump the topic with a quick reply tomorrow morning -- I'm GMT-6:00 -- just so the thread appears with a new post when I check the forum tomorrow.

No bother... I enjoy the puzzles (that's why I'm addicted to this forum ;) )

Cheers,

Kevin
pavia
Super Advanced
Super Advanced
Posts: 39
Joined: Fri Aug 16, 2002 2:39 pm

Post by pavia »

Well, here I am, following Kevin's directions and bumping this topic.

Bump...bump...bump.

Okay, yes...I have nothing intelligent or clever to say.

Bumping done. :-)
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Thanks for the bump. I'll have a look now.

Kevin
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Pavia,

I've been messing with this for a while now and have not had much luck. :? v5 works fine. I can get the v3 menu to appear in NS4, but the rest of the page doesn't load afterward. I'm not an NS4 expert, but I know it has done some other quirky things on me when I've used document.write() in it before.

Anyway, I'm not admitting defeat yet, but I'm taking a break for now (before I break something) and I'll see if I can come up with any fresh ideas. In the meantime, you might consider Ruth's trick of using two different v5 menus, one for NS4 and one for everything else. A simple v5 menu (no fancy stuff) seems to run well in NS4.

Kevin
pavia
Super Advanced
Super Advanced
Posts: 39
Joined: Fri Aug 16, 2002 2:39 pm

Post by pavia »

Now I hate Netscape 4 even more. :-(

You suggest using a simple V5 menu as an alternative...like, no fancy stuff.

Okay...what qualifies as fancy stuff? I'm so non-fancy it's embarassing. :-)

Did my changing my "requirements"--needing this to work for a relatively-positioned menu in a table as opposed to a plain old horizontal one--complicate things? 'Cause if that's the case, I'll change! I'll change! Or is the whole loading-V3-or-loading-V5-based-on-the-browser thing just not do-able?

Whatever the outcome, I just want you to know how much I appreciate your help with this. :D
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi Pavia,
LINK REMOVED. This particular menu only has text because it's for the text section of my site, but I do have one with images, I just dont' do any fancy swap image or swap text like i do for the other version 5 file for other browsers. After all, nn4 is an older browser so I do the 'rule' kiss..keep it simple sam... But the off on colors work. Of course you might like something different than milonic default. This is just a test ;) . I did find out I had to be real careful with the styles on my page. I had to redefine styles for TD to a .td class element because nn4 was reading and assigning that to the menu. Try the page in other than nn4 also, so you can see how different it is on the regular data file.
pavia
Super Advanced
Super Advanced
Posts: 39
Joined: Fri Aug 16, 2002 2:39 pm

Post by pavia »

Ruth...hmmm...I tried the link you provided twice in Netscape 4.79 on the Macintosh. The first time, while mousing over links, my computer froze/crashed and I was forced to do a restart. Hey, it happens...coulda' been something else.

The second time, Netscape choked and quit on me. I'll give it a shot again tomorrow morning but I'm wondering what's up.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Well, it may be a mac issue. It works fine for me, and I'd assume for Kevin since he worked it out. But, I'm on a pc, 98se. So, perhaps that code won't work on macs. It may be that you would have to have macs and nn4.79 ignore the menu and use text links, unless Kevin can get it to call the other version. Perhaps there's something in the code Kevin designed that the macs don't like? I know he had to actually take the drawmenus () out of the data file and put it in the call, perhaps that is something that the mac doesn't like.

Ruth
pavia
Super Advanced
Super Advanced
Posts: 39
Joined: Fri Aug 16, 2002 2:39 pm

Post by pavia »

Sh*t. It happened a third time. The error message is that Netscape unexpectedly quit because of a Type 2 error.

Well, that explains it, huh? :-)

Ahhh...the wonderful world of web design...
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

pavia wrote:...Netscape 4.79 on the Macintosh
Well... there's a twist. I hadn't realized you were using a Mac (sorry... for not realizing it, not for the fact that you're using a Mac). Anything I try is in Windows. My default is Win2k. Don't even know where the nearest Mac might be, although it's definitely in a different building.

I did try a couple more things, but to no avail. The only things I can think of right now are:

(1) The only Type 2 error I know of has to do with statistics... so I can't help you out there.

(2) You could probably accomplish the goal of using a v3 menu for NS4 (Mac or otherwise) and a v5 menu for everything else using server-side scripting (php, asp, etc.). The script could serve a page that directly calls or embeds the correct menu code, rather than trying to figure it out with conditional tests and document.write()'s only on the client side... which NS4 doesn't seem to like very much in this case. Of course, that doesn't help you now, since you don't seem to be using any server-side script to generate pages. But right now, that's the only solution I can see. Are you able to do that?

Kevin
pavia
Super Advanced
Super Advanced
Posts: 39
Joined: Fri Aug 16, 2002 2:39 pm

Post by pavia »

Hiya Kevin...

I can do server-side scripting--PHP. I even bought a book on it.

I'm a page 23.

I'm very good at disassembling and playing with other people's PHP scripts but that's about the extent of my abilities. As it stands, I was including the Version 5 menu via a PHP include so that if there were any changes to the first row of the embedded relatively-positioned menu, I would only have to change one file.

Um...how's your PHP skills?
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hmm, Kevin, is there a way to modify the code you gave me that does work on the pc and I think also on macs not using nn4.79 [I've asked Maz to check] to include something so no menu loads on a mac using nn 4.79? I think I could then put just text links behind the menu for those browsers, right?

Ruth
Post Reply