PDA

View Full Version : Pop Up menu error - argh!


liz
01-23-2010, 10:09 AM
Hi,
I am using the Pop Up menu behaviour and adding it to an image. Have used this plenty of times before but this time am getting an error on page message and it's not working - it does show up but links don't work.
The error on page details are below: Can anyone advise please?
Thanks!


Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; InfoPath.2; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Sat, 23 Jan 2010 11:13:49 UTC

Message: Expected ')'
Line: 485
Char: 18
Code: 0
URI: file:///D:/U05/Y10/DiDA%20group/Unit%204/Group3/Jim/jims%20eportfolio/HTML/mm_menu.js

Message: Expected ')'
Line: 485
Char: 18
Code: 0
URI: file:///D:/U05/Y10/DiDA%20group/Unit%204/Group3/Jim/jims%20eportfolio/HTML/mm_menu.js

edbr
01-24-2010, 01:02 AM
file:///D:/U05/Y10/DiDA%20group/Unit...TML/mm_menu.js (file:///D:/U05/Y10/DiDA%20group/Unit%204/Group3/Jim/jims%20eportfolio/HTML/mm_menu.js)

should not be looking on your computer like this. make the link relative scripts/mm_menu.js (file:///D:/U05/Y10/DiDA%20group/Unit%204/Group3/Jim/jims%20eportfolio/HTML/mm_menu.js)or absolute as in http://www.mysite/scripts/mm_menu.js (file:///D:/U05/Y10/DiDA%20group/Unit%204/Group3/Jim/jims%20eportfolio/HTML/mm_menu.js)
or where ever you have it

liz
01-24-2010, 07:33 AM
Thank you......where do I change this?

I have looked through the js file but I couldn't find the link.

Thanks in advance.

edbr
01-24-2010, 07:41 AM
i imagine its in your <head> tags where you link to the javascript file

liz
01-24-2010, 09:54 AM
I couldnt see it there either. The code there says:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Proposal2</title>
<style type="text/css">
<!--
body {
background-color: #FFCC66;
}
-->
</style>
<script language="JavaScript">
<!--
function mmLoadMenus() {
if (window.mm_menu_0123104708_0) return;
window.mm_menu_0123104708_0 = new Menu("root",54,20,"Verdana, Arial, Helvetica, sans-serif",14,"#000000","#ffcc66","#ffcc66","#000033","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
mm_menu_0123104708_0.addMenuItem("Email","window.open('PDF's/email.pdf', '_blank');");
mm_menu_0123104708_0.bgImageUp="mmmenu1_54x20_up.gif";
mm_menu_0123104708_0.bgImageOver="mmmenu1_54x20_over.gif";
mm_menu_0123104708_0.fontWeight="bold";
mm_menu_0123104708_0.fontStyle="italic";
mm_menu_0123104708_0.hideOnMouseOut=true;
mm_menu_0123104708_0.bgColor='#555555';
mm_menu_0123104708_0.writeMenus();
} // mmLoadMenus()
//-->
</script>
<script language="JavaScript1.2" src="mm_menu.js"></script>
</head>

Frustrating, huh.

Any further idea?

Thanks for your help.

gentleone
01-24-2010, 03:51 PM
I couldnt see it there either. The code there says:
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Proposal2</title>
<style type="text/css">
<!--
body {
background-color: #FFCC66;
}
-->
</style>
<script language="JavaScript">
<!--
function mmLoadMenus() {
if (window.mm_menu_0123104708_0) return;
window.mm_menu_0123104708_0 = new Menu("root",54,20,"Verdana, Arial, Helvetica, sans-serif",14,"#000000","#ffcc66","#ffcc66","#000033","left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
mm_menu_0123104708_0.addMenuItem("Email","window.open('PDF's/email.pdf', '_blank');");
mm_menu_0123104708_0.bgImageUp="mmmenu1_54x20_up.gif";
mm_menu_0123104708_0.bgImageOver="mmmenu1_54x20_over.gif";
mm_menu_0123104708_0.fontWeight="bold";
mm_menu_0123104708_0.fontStyle="italic";
mm_menu_0123104708_0.hideOnMouseOut=true;
mm_menu_0123104708_0.bgColor='#555555';
mm_menu_0123104708_0.writeMenus();
} // mmLoadMenus()
//-->
</script>
<script language="JavaScript1.2" src="mm_menu.js"></script>
</head>

Frustrating, huh.

Any further idea?

Thanks for your help.

The javascript call is there... see blue, but I think you have to add type="text/javascript" to it. So it should be like this:
<script language="JavaScript1.2" src="mm_menu.js" type="text/javascript"></script>

Make also sure that the javascript file mm_menu.js is indeed in your root folder.

liz
01-24-2010, 03:56 PM
OK thanks. Will try that.
The js file is there in the root folder but I will try and add what you suggest!

Liz

liz
01-24-2010, 04:05 PM
Nope!
The stupid thing is that on one site it is working fine and on the other it is not....I've even tried copying and pasting the code from one to the other and changing the paths but it's just won't have it.

edbr
01-25-2010, 07:53 AM
try
<script type="text/javascript" src="mm_menu.js">

gentleone
01-25-2010, 08:15 AM
I think also the following order of the javascript calls in this case is important.

First you have to call the mm_menu.js and after that the function mmLoadMenus ()

So like this:
<script type="text/javascript" src="mm_menu.js"></script>
<script type="text/javascript">
<!--
function mmLoadMenus() {
if (window.mm_menu_0123104708_0) return;
window.mm_menu_0123104708_0 = new Menu("root",54,20,"Verdana, Arial, Helvetica, sans-serif",14,"#000000","#ffcc66","#ffcc66","#000033", "left","middle",3,0,1000,-5,7,true,true,true,0,true,true);
mm_menu_0123104708_0.addMenuItem("Email","window.o pen('PDF's/email.pdf', '_blank');");
mm_menu_0123104708_0.bgImageUp="mmmenu1_54x20_up.g if";
mm_menu_0123104708_0.bgImageOver="mmmenu1_54x20_ov er.gif";
mm_menu_0123104708_0.fontWeight="bold";
mm_menu_0123104708_0.fontStyle="italic";
mm_menu_0123104708_0.hideOnMouseOut=true;
mm_menu_0123104708_0.bgColor='#555555';
mm_menu_0123104708_0.writeMenus();
} // mmLoadMenus()
//-->
</script>

gentleone
01-25-2010, 08:23 AM
And now I look good to the function mmLoadMenus() I see some typos


mm_menu_0123104708_0.addMenuItem("Email","window.o pen('PDF's/email.pdf', '_blank');");
mm_menu_0123104708_0.bgImageUp="mmmenu1_54x20_up.g if";
mm_menu_0123104708_0.bgImageOver="mmmenu1_54x20_ov er.gif";


1st line: you have window.o pen
There is a space between 'o' and 'pen'
2nd line: you have mmmenu1_54x20_up.g if
There is a space between 'g' and 'if'
3rd line: you have mmmenu1_54x20_ov er.gif
There is a space betweeb 'ov' and 'er'