Menu does not work locally

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
Gatekeeper
Beginner
Beginner
Posts: 3
Joined: Mon Oct 25, 2004 2:41 pm
Location: Aalborg, Denmark
Contact:

Menu does not work locally

Post by Gatekeeper »

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...
//Bo
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

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

Ruth
Gatekeeper
Beginner
Beginner
Posts: 3
Joined: Mon Oct 25, 2004 2:41 pm
Location: Aalborg, Denmark
Contact:

Post by Gatekeeper »

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: Select all

<?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">
<%@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">
//Bo
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

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.
John
User avatar
fredlongworthhighschool
Mega Advanced
Mega Advanced
Posts: 362
Joined: Fri Jun 27, 2003 11:34 am
Location: Manchester, England.
Contact:

Post by fredlongworthhighschool »

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: Select all

var BaseHref="";	// BaseHref lets you specify the root directory for relative links. 
Perhaps this could be added to the 'wish list'?
Andy Davis
Web Designer & Smartboard Manager

Fred Longworth High School, Manchester, England.
Gatekeeper
Beginner
Beginner
Posts: 3
Joined: Mon Oct 25, 2004 2:41 pm
Location: Aalborg, Denmark
Contact:

Post by Gatekeeper »

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: Select all

<!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: Select all

_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://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();
//Bo
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

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.
John
Post Reply