Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

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:05

Menu does not work locally


Poster: Gatekeeper
Dated: Monday October 25 2004 - 14:53:19 BST

Hi...

After I registred my menu, it does not work on my local computer.
I get an error saying : 'mm_style' is not defined. ( in line 9 )

On my live website ( http://www.bitzer.dk/profile/ ) the menu works perfectly...

The files on my webserver are the same as on my local machine, where the website run from http://localhost/bitzer.dk/profile/

I'm using ver. 5.51

Thank You...


Poster: Ruth
Dated: Monday October 25 2004 - 20:48:15 BST

Have you checked the paths to the milonic files on the local?

Ruth


Poster: Gatekeeper
Dated: Monday October 25 2004 - 22:13:45 BST

Yes, the files is located in the same folders, as on the webserver.
The one difference is that on my localhost all files are in a subdir.

I guess that the problem is in the error message saying : 'mm_style' is not defined.

I have included some code from my page. The rest of the page is some divs, which i style through my style sheet...

Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<% __at__ LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Bitzer.dk</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../Css/Digital.Profile.css" rel="stylesheet" type="text/css">

</head>
<script type="text/javascript" language="JavaScript" src="../js/menu/milonic_src.js"></script>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=../js/mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=../js/mmenudom.js><\/scr"+"ipt>");
</script>
<script type="text/javascript" language="JavaScript" src="../js/menu/menu_data.asp"></script>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">


Poster: John
Dated: Tuesday October 26 2004 - 0:03:09 BST

You're getting the error because the system cannot find the menu code files. Try not to use the ../ type of addressing - typically messes things up. Use server relative, which would be just a leading / . Make sure your local exactly matches your remote setup.


Poster: fredlongworthhighschool
Dated: Tuesday October 26 2004 - 9:29:36 BST

I have a similar problem. Our hosted website is fine, but we have problems with the local copy as it's not in a 'root'. I've got by with managing to work around and put up with it

I did once see another menu system which had this command:

Code:
var BaseHref="";   // BaseHref lets you specify the root directory for relative links.


Perhaps this could be added to the 'wish list'?


Poster: Gatekeeper
Dated: Tuesday October 26 2004 - 11:51:16 BST

Thanks for your reply John.

Unfortunally, it's not helping in this situation.

To test the menu, I included the menu on my front page default.asp
The structure of my files is like this.
/(root)
/default.asp
/js/menu/(menufiles)

To furture test if the menu works, I made a test file (menutest.asp) in the Menu folder. This file comes up with the same error as mentioned before.
As you can see I made the paths absolute, to make sure that there's no doubt in where the menu files are placed.

menutest.asp
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script type="text/javascript" language="JavaScript" src="http://localhost/bitzer.dk/js/menu/milonic_src.js"></script>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=http://localhost/bitzer.dk/js/menu/mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=http://localhost/bitzer.dk/js/menu/mmenudom.js><\/scr"+"ipt>");
</script>
<script type="text/javascript" language="JavaScript" src="http://localhost/bitzer.dk/js/menu/menu_data.asp"></script>
<body>
</body>
</html>


I wonder if it is because it's a licenced menu and therefore only run on the site to which it is registred to.

Or is it because I have changed menu_data.js to .asp.
(want to make it dynamic later)

Here's my menu_data.asp file
Code:
_menuCloseDelay=500           // The time delay for menus to remain visible on mouse out
_menuOpenDelay=150            // The time delay before menus open on mouse over
_subOffsetTop=10              // Sub menu top offset
_subOffsetLeft=-10            // Sub menu left offset

/*
with(menuStyle=new mm_style()){
onbgcolor="#002775";         // onmouseover
oncolor="#C2C2C2";            // onmouseover text color
offbgcolor="#C2C2C2";         // bgcolor
offcolor="#002775";
bordercolor="#999999";
borderstyle="none";
borderwidth=1;
separatorcolor="#999999";
separatorsize="0";
padding=5;
fontsize="100%";
fontstyle="normal";
fontfamily="'trebuchet MS',Verdana, Tahoma, Arial";
pagecolor="black";
pagebgcolor="#82B6D7";
headercolor="#000000";
headerbgcolor="#ffffff";
subimage="";
subimagepadding="2";
}
*/

with(menuStyleLevel1=new mm_style()){
   onclass="menuLevel1on";
   offclass="menuLevel1off";
}

with(menuStyleLevel2=new mm_style()){
   onclass="menuLevel2on";
   offclass="menuLevel2off";
}

with(menuStyleLevel3=new mm_style()){
   onclass="menuLevel3on";
   offclass="menuLevel3off";
}

with(milonic=new menuname("MainMenu")){
style=menuStyleLevel1;
top=25;
screenposition="center";
left="offset=-318";
orientation="horizontal";
alwaysvisible=1;
aI("text=Menu;status=Her i menuen finder du informationer om mig og mit arbejde;showmenu=SubMenu;");
}

with(milonic=new menuname("SubMenu")){
style=menuStyleLevel2;
orientation="horizontal";
screenposition="center";
top=49;
left="offset=-201";
aI("text=Referencer;url=Referencer.asp;showmenu=MyWork");
aI("text=Facts (CV);url=../cv;status=Mit CV - i en printvenlig version;target=_blank");
aI("text=Mere om mig;showmenu=OmMig");
aI("text=Links;showmenu=Links;");
aI("text=Kontakt;url=Kontakt.asp;status=Kontakt informationer");
}

with(milonic=new menuname("MyWork")){
style=menuStyleLevel3;
orientation="horizontal";
top=73;
screenposition="center";
left="offset=-28";
aI("text=Invaders from Earth;url=Invaders.asp;");
aI("text=ShowCom.dk;url=ShowCom.asp;");
aI("text=Cadskolen.dk;url=Cadskolen.asp;");
aI("text=Nyledige.dk;url=Nyledige.asp;");
aI("text=Online Word Editor;url=WordEditor.asp;");
aI("text=Afstemnings boks;url=AfstemningsBoks.asp;");
aI("text=Det digitale t&oslash;jskab;url=DigitalWalkingCloset.asp;");

}

with(milonic=new menuname("Links")){
style=menuStyleLevel3;
orientation="horizontal";
top=73;
screenposition="center";
left="offset=-88";
aI("text=Thomas Kello;url=http://kello.info/;status=En meget dygtig grafiker - værd at ansætte;target=_blank;");
aI("text=Milonic;url=http://www.milonic.com/;status=God og funktionel menu. Let at arbejde med.;target=_blank;");
}

with(milonic=new menuname("OmMig")){
style=menuStyleLevel3;
orientation="horizontal";
top=73;
screenposition="center";
left="offset=-155";
aI("text=Som Person;url=SomPerson.asp;status=Mig som person;");
aI("text=i Fritiden;url=Fritiden.asp;status=Hvad jeg bruger min fritid på;");
}

drawMenus();


Poster: John
Dated: Tuesday October 26 2004 - 13:54:36 BST

On your localhost you have set bitzer.dk as a directory, which it is not on the remote server. It's your domain name, and on the remote does not reside in a directory by that name. A typical actual path on the remote is /www/htdocs/, or something along those lines. Your files there reside in /htdocs/, which to the outside world is bitzer.com. Therefore the local setup does not match the remote.

Gatekeeper wrote:
I wonder if it is because it's a licenced menu and therefore only run on the site to which it is registred to.

That's not the way it works. The menu will still run (I think), but will pop the MILONIC item in the first menu.
Gatekeeper wrote:
Or is it because I have changed menu_data.js to .asp.

Does your local server understand .asp? Not all do. Quick check would be to change it back to .js and see what happens.