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:38
Can NN4 be forced to call a different menu_data.js file?
Poster: Ruth
Dated: Sunday March 14 2004 - 23:39:52 GMT
I made this a new topic from the one about having netscape ignore the menu. I was trying to figure how to call v3 for nn4, but then realized all I need it to do is call a different menu_data.js file designed for it specifically. I've tried any number of combinations of the different codes Kevin and Tep were playing with under this topic: http://www.milonic.com/forum/viewtopic.php?t=3692&postdays=0&postorder=asc&start=0 , but no matter what I do, all I can seem to do is get nn4 to ignore the menu and get all the other browsers to load it using any of those codes or my creative rewriting of them [ie. I have NO idea what I'm writing, but it sure is creative...nevertheless it doesn't give any errors, a good thing!] Some of what I've tried
Code:
#1<SCRIPT language=JavaScript src="milonic_src.js" type="text/javascript"></SCRIPT>
<script language="javascript">
_NS4 = (document.layers) ? true : false;
if(!_NS4) {
document.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
document.write("<scr"+"ipt language=JavaScript src=data_2004.js><\/scr"+"ipt>");
}
else {
document.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
document.write("<scr"+"ipt language=JavaScript src=ns4_data.js><\/scr"+"ipt>");
}
</script>
#2<script language="javascript">
_NS4 = (document.layers) ? true : false;
if(!_NS4) {
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=data_2004.js><\/scr"+"ipt>");
}
else {
document.write("<scr"+"ipt language=JavaScript src=milonic_src.js><\/scr"+"ipt>");
document.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
document.write("<scr"+"ipt language=JavaScript src=ns4_data.js><\/scr"+"ipt>");
}
</script>
#3<SCRIPT language=JavaScript src="milonic_src.js" type="text/javascript"></SCRIPT>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
</script>
<script language="javascript">
_NS4 = (document.layers) ? true : false;
if (_NS4) {
document.write("<scr"+"ipt language=JavaScript src=ns4_data.js><\/scr"+"ipt>");
}
else {
document.write("<scr"+"ipt language=JavaScript src=data_2004.js><\/scr"+"ipt>");
}
</script>
<script language="javascript">
_NS4 = (document.layers) ? true : false;
if(!_NS4) {
document.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
document.write("<scr"+"ipt language=JavaScript src=data_2004.js><\/scr"+"ipt>");
}
else {
document.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
document.write("<scr"+"ipt language=JavaScript src=ns4_data.js><\/scr"+"ipt>");
}
</script>
#2<script language="javascript">
_NS4 = (document.layers) ? true : false;
if(!_NS4) {
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=data_2004.js><\/scr"+"ipt>");
}
else {
document.write("<scr"+"ipt language=JavaScript src=milonic_src.js><\/scr"+"ipt>");
document.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
document.write("<scr"+"ipt language=JavaScript src=ns4_data.js><\/scr"+"ipt>");
}
</script>
#3<SCRIPT language=JavaScript src="milonic_src.js" type="text/javascript"></SCRIPT>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
</script>
<script language="javascript">
_NS4 = (document.layers) ? true : false;
if (_NS4) {
document.write("<scr"+"ipt language=JavaScript src=ns4_data.js><\/scr"+"ipt>");
}
else {
document.write("<scr"+"ipt language=JavaScript src=data_2004.js><\/scr"+"ipt>");
}
</script>
They all worked fine for other than nn4 browsers, can't check on macs though. None would have nn4 load the ns4_data.js file. I tried lots of other combinations, I even tried to do it with the full main menu code in the document.write section. Any help would be appreciated. Either to do this or to load v3 instead. Though I would prefer using just one system. Thanks
Ruth
Poster: Maz
Dated: Monday March 15 2004 - 7:01:48 GMT
You didn't post a url, so I checked the link. What happened in Safari besides crashing the browser, was when I moused over the submenus the page went blank, when the menu closed the page returned, very strange.
maz
Poster: Ruth
Dated: Monday March 15 2004 - 16:56:55 GMT
What link, Maz? You mean my www site? I didn't put any of that up on the site, so there's some problem with the menu that's up now. Do you know which page? Was it the one with the lake applet? It may be the old rc that's up, I'm just finishing all the pages to put up the newest version.
Ruth
Poster: Ruth
Dated: Monday March 15 2004 - 20:41:05 GMT
Here's a link. At the bottom of the page is a next link..does that 3 times for 4 codes. Would appreciate if Mac is tested on this. I know the nn4 doesn't call the menu, but if I know the codes at least call it in others I'll keep playing and trying to figure out how to do it. Don't pay attention to how the menu is opening, I'm playing with it also.
http://www.poems2u.com/1/a/test3.htm
Ruth
Poster: Maz
Dated: Monday March 15 2004 - 22:46:01 GMT
The menu at the bottom of the page is working okay in Safari.
I think a menu at the bottom is better than top because it doesn't overlap the text.
Its my turn to be ill this week, must go lay down again:(
maz
Poster: John
Dated: Monday March 15 2004 - 23:01:23 GMT
Sorry, hon - didn't mean to get you sick, too...
Re: Can NN4 be forced to call a different menu_data.js file?
Poster: kevin3442
Dated: Monday March 15 2004 - 23:17:22 GMT
Hi Ruth,
innkeeper9 wrote:
...I was trying to figure how to call v3 for nn4, but then realized all I need it to do is call a different menu_data.js file designed for it specifically....
I've been off the boards for a while, ad a bunch of traveling to do and have also been under the gun to get some actual work done for a pressing deadline. Anyway, you could try a twist on the way the script files are normally loaded. Suppose you have menu_data for ns4 in a file called "menu_data_ns4.js" and menu_data for DOM browsers in a file called "menu_data_dom.js". You could load them conditionally, based on a value that's already set in milonic_src.js, like so:
Code:
<script language=JavaScript src="milonic_src.js" type=text/javascript></script>
<script language=JavaScript>
if(ns4) {
_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
_d.write("<scr"+"ipt language=JavaScript src=menu_data_ns4.js><\/scr"+"ipt>");
}
else {
_d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
_d.write("<scr"+"ipt language=JavaScript src=menu_data_dom.js><\/scr"+"ipt>");
}
</script>
<script language=JavaScript>
if(ns4) {
_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
_d.write("<scr"+"ipt language=JavaScript src=menu_data_ns4.js><\/scr"+"ipt>");
}
else {
_d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
_d.write("<scr"+"ipt language=JavaScript src=menu_data_dom.js><\/scr"+"ipt>");
}
</script>
The above lines would be used instead of the more standard lines that follow:
Code:
<script language=JavaScript src="milonic_src.js" type=text/javascript></script>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
</script>
<script language=JavaScript src="menu_data.js" type=text/javascript></script>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
</script>
<script language=JavaScript src="menu_data.js" type=text/javascript></script>
Hope that helps. I'm off to look for a few others I might be able to help with tonight...
Kevin
Poster: Ruth
Dated: Tuesday March 16 2004 - 0:43:00 GMT
Welcome back, Kevin.
I tried that code, what happens is that netscape just doesn't load anything. And, I cannot figure out why. If you view source it shows the
Code:
<script language=JavaScript src="milonic_src.js" type=text/javascript></script>
But that's all, no menu loads. It is driving me nuts. There MUST be a way to have nn4 just call a different data file. grrrrrr
edit: Meant to tell you Kevin, I love that filter you have on your site. Really neat.
Ruth
Poster: kevin3442
Dated: Tuesday March 16 2004 - 1:58:46 GMT
Hi Ruth,
innkeeper9 wrote:
Welcome back, Kevin.
Thanks.
Quote:
I tried that code, what happens is that netscape just doesn't load anything...
Hmmm... it works for me... sort of. Using Win2k/NS4.75, the NS4 version loads, but it takes a very long time to load. That isn't unusual from my point of view... I've noticed that, when I do venture to load a test menu in NS4, it often takes a very long time. I have never taken the time to figure ot if that's a general phenomenon, or related to my own local installation of NS4, or related to any particular menu properties. I don't recall v3 taking so long to load, but I just tried an old v3.5.15 menu and it also takes forever. That leads me to believe that something peculiar (besides NS4 itself) on my machine is causing the slowdown, so I might just (gulp) uninstall/re-install NS4.
Anway, I edited my previous post because I noticed I had written menu_adta_dom.js instead of menu_data_dom.js. At least I think it was the dom version. You might double-check to see if you've made any typos... is the ns4 version of your menu_data file actually there? Also, try loading your test page and then waiting a long time to see if it eventually loads.
Quote:
edit: Meant to tell you Kevin, I love that filter you have on your site. Really neat.
Thanks again. I recently changed the filters from a pixelate filter after playing around some on a new rendition of our site design. If you're curious, you can have a look at what I'm messing with for the new version here (make sure you scroll down for the full effect). Keep in mind that it's a work in progress (my disclaimer for anything that looks silly ). It's best viewed with IE5.5+ in Windows.
We'll keep working at the NS4-only menu thing.
Kevin
Poster: Ruth
Dated: Tuesday March 16 2004 - 6:28:50 GMT
Ok, I finally got the menu to load. But, it's the only thing that loads it just keeps saying reading file done and continues to have the little icon turning while it doesn't load anything on the page. http://www.poems2u.com/1/a/kevin_codes.htm
edit: forgot to say, I waited 10 doggone minutes to see if the page would finish loading!
And, oooh I really like your page, very striking and yet it's uncluttered. Like that a lot!
Ruth
Poster: kevin3442
Dated: Wednesday March 17 2004 - 0:45:30 GMT
Ruth,
I'm having trouble even getting NS4 to run right now (big surprise). It keep crashing on me. So, I'll have to fiddle some more. Sorry it's taking so long.
ruth wrote:
And, oooh I really like your page, very striking and yet it's uncluttered. Like that a lot!
Thanks. I'm glad you mentioned "uncluttered", because that's exactly what I was shooting for.
Kevin
Poster: Ruth
Dated: Wednesday March 17 2004 - 2:32:35 GMT
Thanks for trying Kevin. A link to see what's going on HERE where the page is trying to load 2 different version 5 data files. Also, HERE is for trying to load version 3 using your code that is split, version5 in the head, version3 in the body. That throws the javascript error: mmenu.js line
452: _d.layers[mnu] has no properties.
If we can't figure out why it's taking so long for 5 to load, perhaps calling 3, if we can would be a solution.
Ruth
Poster: John
Dated: Wednesday March 17 2004 - 14:19:36 GMT
kevin3442 wrote:
Thanks. I'm glad you mentioned "uncluttered", because that's exactly what I was shooting for.
"Uncluttered"! Of course it is - there's nothing on it except a header and the menu Or is the text all white...
Actually, it does look good, but I couldn't let the "insightful followscroll" comment go unanswered
Poster: kevin3442
Dated: Wednesday March 17 2004 - 23:16:41 GMT
jgillett wrote:
...Or is the text all white...
Actually, there's an advanced visitor sniffer script. Going beyond mere browser and platform detection, this script checks the site visitor and removes all page content if he or she has been anywhere near a Mac within the past 48 hours!
Quote:
Actually, it does look good, but I couldn't let the "insightful followscroll" comment go unanswered
What about the "very well written" part? You gonna let that slide?
Kevin
Poster: kevin3442
Dated: Wednesday March 17 2004 - 23:28:36 GMT
OK Ruth, I think I have a working approach to loading two different v5 menus.
First, I don't know what the deal was, but I completely removed my NS4.75 and installed NS4.79 (I upgraded!) Now stuff that used to work for me in NS4 works again in NS4.
I tried the last approach I outlined earlier. In NS4, the menu appeared right away, but the rest of the page never loaded... just like you described. I'm not sure, but I have a hunch that it has something to do with using the document.write() method in NS4. I recall reading something a lon time ago about having to flush the write buffer (or sime such stuff) in NS4, but I can't for the life of me find that reference. So, I played around.
I've found that the followig works for me:
(1) Remove the last line, drawMenus(), from the menu_data_ns4.js file. If you like, you can just "comment it out" by placing // at the start of the line, like
Code:
// drawMenus();
(2) Use the following code to load the menu scripts and your menu_data scripts (a slight modification of the code I posted earlier).
Code:
<script language=JavaScript src="milonic_src.js" type=text/javascript></script>
<script language=JavaScript>
if (ns4) {
_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
_d.write("<scr"+"ipt language=JavaScript src=menu_data_ns4.js><\/scr"+"ipt>");
drawMenus();
}
else {
_d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
_d.write("<scr"+"ipt language=JavaScript src=menu_data_dom.js><\/scr"+"ipt>");
}
</script>
<script language=JavaScript>
if (ns4) {
_d.write("<scr"+"ipt language=JavaScript src=mmenuns4.js><\/scr"+"ipt>");
_d.write("<scr"+"ipt language=JavaScript src=menu_data_ns4.js><\/scr"+"ipt>");
drawMenus();
}
else {
_d.write("<scr"+"ipt language=JavaScript src=mmenudom.js><\/scr"+"ipt>");
_d.write("<scr"+"ipt language=JavaScript src=menu_data_dom.js><\/scr"+"ipt>");
}
</script>
Note the addition of the call to drawMenus() in the if(ns4) block. For some reason, leaving that function call in menu_data_ns4.js makes the page load and load and load and... never completely load. But by putting it in the html directly, menu loads and the rest of the page loads almost immediately. Don't ask me why... I have no idea.
Give it a shot and let us know what you find out.
Kevin
Poster: Ruth
Dated: Thursday March 18 2004 - 0:31:59 GMT
WOO HOO Thank you soooo much. Now I can do all the neat things I want with the menu. It works really well on the web. Not too slow at all [after all it's a very old browser] Check it out
::hugs:: You have made my day. I can now actually get the site finished!
Ruth
Poster: kevin3442
Dated: Thursday March 18 2004 - 1:11:57 GMT
Hi Ruth,
Well I checked it out... seems to work pretty well! The NS4 version loaded in about 5 seconds (Win2k/NS4.79/Cable) and worked well.
Glad it worked... thanks for the hugs
Nice over/out filters on the non-NS4 version BTW
Cheers,
Kevin
Poster: Ruth
Dated: Thursday March 18 2004 - 3:38:26 GMT
::looking for the handcuffs:: Yes, I got them from your site. And, that reminds me...? but will post as new issue so others can see it, about using the class attribute with that effect.
http://www.milonic.com/forum/viewtopic.php?p=16705#16705
Ruth