Reply
Errors with Javascript
Old 07-26-2007, 06:47 PM Errors with Javascript
Junior Talker

Posts: 3
Name: Mark
Trades: 0
I am having some trouble with some web pages and particularly with dropdown menus. Using Dreamweaver's behaviors, I created some dropdown menus on mouse rollover. Everything works fine locally, but when I upload the file to the server to test, the images are incomplete and I get errors both in IE and Firefox.

The IE error says:

Line: 204
Char: 1
Error: Object expected
Code: 0

With Firefox, I get the following errors:

Menu is not defined
MM_showMenu is not defined
MM_startTimeout is not defined
and
uncaught exception: Permission denied to call method Location.toString

I'm guessing that these errors are due to javascript not being found? If so, how is the javascript uploaded to the server? How do you upload the script? What files?

Some of the code is below. I've truncated some of it as there is a lot. In the <head> section, it looks as if the scripts are being defined, but they won't work on the remote versions. Below, I also pasted in the part of the code where the "object expected" error was.

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function mmLoadMenus() {
if (window.mm_menu_0419160234_0) return;
window.mm_menu_0419160234_0 = new Menu("root",87,20,"",14,"#000000","#FFFFFF","#E8E9 D1","#990000","left","middle",3,0,1000,-5,7,true,false,true,0,true,true);
mm_menu_0419160234_0.addMenuItem("About&nbsp;Us"," location='about/about.html'");
mm_menu_0419160234_0.fontWeight="bold";
mm_menu_0419160234_0.hideOnMouseOut=true;
mm_menu_0419160234_0.bgColor='#555555';
mm_menu_0419160234_0.menuBorder=1;
mm_menu_0419160234_0.menuLiteBgColor='#FFFFFF';
mm_menu_0419160234_0.menuBorderBgColor='#777777';

window.mm_menu_0419162749_0 = new Menu("root",87,20,"",14,"#000000","#FFFFFF","#FFFF FF","#990000","left","middle",3,0,150,-5,7,true,false,true,0,true,true);
mm_menu_0419162749_0.addMenuItem("About&nbsp;Us"," location='about/about.html'");
mm_menu_0419162749_0.fontWeight="bold";
mm_menu_0419162749_0.hideOnMouseOut=true;
mm_menu_0419162749_0.bgColor='#555555';
mm_menu_0419162749_0.menuBorder=1;
mm_menu_0419162749_0.menuLiteBgColor='#FFFFFF';
mm_menu_0419162749_0.menuBorderBgColor='#777777';
window.mm_menu_0419162913_0 = new Menu("root",145,20,"",14,"#000000","#FFFFFF","#FFF FFF","#990000","left","middle",3,0,150,-5,7,true,false,true,0,true,true);
mm_menu_0419162913_0.addMenuItem("Skin&nbsp;Cancer &nbsp;Info","location='skin_cancer/skin-cancer.html'");
mm_menu_0419162913_0.addMenuItem("Skin&nbsp;Cancer &nbsp;FAQs","location='skin_cancer/skin-cancer-faqs.html'");
mm_menu_0419162913_0.addMenuItem("Mohs&nbsp;Surger y","location='skin_cancer/mohs.html'");
mm_menu_0419162913_0.fontWeight="bold";
mm_menu_0419162913_0.hideOnMouseOut=true;
mm_menu_0419162913_0.bgColor='#555555';
mm_menu_0419162913_0.menuBorder=1;
mm_menu_0419162913_0.menuLiteBgColor='#FFFFFF';
mm_menu_0419162913_0.menuBorderBgColor='#777777';
window.mm_menu_0419164153_0 = new Menu("root",109,20,"",14,"#000000","#FFFFFF","#FFF FFF","#990000","left","middle",3,0,150,-5,7,true,false,true,0,true,true);
mm_menu_0419164153_0.addMenuItem("Clinical&nbsp;Tr ials","location='clinical/trials.html'");
mm_menu_0419164153_0.fontWeight="bold";
mm_menu_0419164153_0.hideOnMouseOut=true;
mm_menu_0419164153_0.bgColor='#555555';
mm_menu_0419164153_0.menuBorder=1;
mm_menu_0419164153_0.menuLiteBgColor='#FFFFFF';
mm_menu_0419164153_0.menuBorderBgColor='#777777';
window.mm_menu_0419164235_0 = new Menu("root",137,20,"",14,"#000000","#FFFFF


Error on page - "Object expected"

<td valign="top"><a href="../about/about-us.html"><img src="../graphics/homenav_about-2.gif" name="image1" width="100" height="30" border="0" id="image1" onMouseOver="MM_showMenu(window.mm_menu_0419162749 _0,10,30,null,'image1')" onMouseOut="MM_startTimeout();"></a><a href="../skin_cancer/skin-cancer-overview.html"><img src="../graphics/homenav_cancer-2.gif" name="image2" width="100" height="30" border="0" id="image2" onMouseOver="MM_showMenu(window.mm_menu_0419162913 _0,5,30,null,'image2')" onMouseOut="MM_startTimeout();"></a><a href="../clinical/clinical-trials.html"><img src="../graphics/homenav_clinical-2.gif" name="image3" width="120" height="30" border="0" id="image3" onMouseOver="MM_showMenu(window.mm_menu_0419164153 _0,5,30,null,'image3')" onMouseOut="MM_startTimeout();"></a><a href="cosmetic-about.html"><img src="../graphics/homenav_cosmetic-2.gif" name="image4" width="152" height="30" border="0" id="image4" onMouseOver="MM_showMenu(window.mm_menu_0419164235 _0,5,30,null,'image4')" onMouseOut="MM_startTimeout();"></a><a href="../office/office-information.html"><img src="../graphics/homenav_office-2.gif" name="image5" width="190" height="30" border="0" id="image5" onMouseOver="MM_showMenu(window.mm_menu_0419164507 _0,5,30,null,'image5')" onMouseOut="MM_startTimeout();"></a><a href="../staff/gladstone.html"><img src="../graphics/homnav_staff-2.gif" name="image6" width="120" height="30" border="0" id="image6" onMouseOver="MM_showMenu(window.mm_menu_0419164614 _0,5,30,null,'image6')" onMouseOut="MM_startTimeout();"></a></td>
</tr>


I'd appreciate any help I can get.

Thank you!
mountainbear1 is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 07-26-2007, 06:51 PM Re: Errors with Javascript
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,942
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Since you're using the ultra-code-ugly Dr*amw*av*r, chances are the Javascript is embedded into the page itself. This means that you should only have to upload the page to see it.

Check to make sure the code in your remote version matches the code on your local version. It sounds like something got truncated.
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 07-27-2007, 08:49 AM Re: Errors with Javascript
Experienced Talker

Latest Blog Post:
Long time no … erm post?
Posts: 45
Name: Matthew Bagley
Trades: 0
I hate the MM javascripts that dreamweaver give you

the uncaught exception is a problem with firefox I get it a lot of times but it doesn't stop the code from working. from what I can see it cant find your JS functions
__________________
Matthew Bagley
Paramiliar Design Studios
Who am I | Free Layouts |Website Development | UK SEO
Paramiliar is offline
Reply With Quote
View Public Profile
 
Old 07-27-2007, 11:19 AM Re: Errors with Javascript
Junior Talker

Posts: 3
Name: Mark
Trades: 0
Thank you, Mathhew & BillyRandyFreddieJoeFloydBob! I'll poke around a little more and see if I can resolve this. If not, I'll have to post again!

mountainbear1 is offline
Reply With Quote
View Public Profile
 
Old 07-30-2007, 07:08 PM Re: Errors with Javascript
Junior Talker

Posts: 3
Name: Mark
Trades: 0
Hi

I'm still having trouble with the DW drop down menus. I've uploaded the javascript .js files
to the directory on the webserver, but now I'm getting an error that Firefox says
is at line 721 in the javascript.


Below is the DW javascript code from line 715 - end

function hideActiveMenus() {
if (!window.activeMenus) return;
for (var i=0; i < window.activeMenus.length; i++) {
if (!activeMenus[i]) continue;
if (activeMenus[i].visibility && activeMenus[i].Menu && !window.mmIsOpera) {
activeMenus[i].visibility = "hidden";
activeMenus[i].Menu.container.visibility = "hidden";
activeMenus[i].Menu.container.clip.left = 0;
} else if (activeMenus[i].style) {
var s = activeMenus[i].style;
s.visibility = "hidden";
s.left = '-200px';
s.top = '-200px';
}
}
if (window.ActiveMenuItem) hideMenu(false, false);
window.activeMenus.length = 0;
}

function moveXbySlicePos (x, img) {
if (!document.layers) {
var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;
var par = img;
var lastOffset = 0;
while(par){
if( par.leftMargin && ! onWindows ) x += parseInt(par.leftMargin);
if( (par.offsetLeft != lastOffset) && par.offsetLeft ) x += parseInt(par.offsetLeft);
if( par.offsetLeft != 0 ) lastOffset = par.offsetLeft;
par = macIE45 ? par.parentElement : par.offsetParent;
}
} else if (img.x) x += img.x;
return x;
}

function moveYbySlicePos (y, img) {
if(!document.layers) {
var onWindows = navigator.platform ? navigator.platform == "Win32" : false;
var macIE45 = document.all && !onWindows && getExplorerVersion() == 4.5;
var par = img;
var lastOffset = 0;
while(par){
if( par.topMargin && !onWindows ) y += parseInt(par.topMargin);
if( (par.offsetTop != lastOffset) && par.offsetTop ) y += parseInt(par.offsetTop);
if( par.offsetTop != 0 ) lastOffset = par.offsetTop;
par = macIE45 ? par.parentElement : par.offsetParent;
}
} else if (img.y >= 0) y += img.y;
return y;
}



If I view the page source, the end of the code appears truncated right at the
point of the error. Is this normal or has the javascript file been truncated
when being put to the server?

Here is the page source code:

function hideActiveMenus() {
if (!window.activeMenus) return;
for (var i=0; i < window.activeMenus.length; i++) {
if (!activeMenus[i]) continue;
if (activeMenus[i].visibility && activeMenus[i].Menu && !window.mmIsOpera) {
activeMenus[i].visibility = "hidden";
activeMenus[i].Menu

Note that although there is code after the activeMenus[i].Menu
it does not show in the page source. Is this normal?

Thanks!
mountainbear1 is offline
Reply With Quote
View Public Profile
 
Old 07-31-2007, 03:49 AM Re: Errors with Javascript
Experienced Talker

Latest Blog Post:
Long time no … erm post?
Posts: 45
Name: Matthew Bagley
Trades: 0
Nope this isn't normall and it is probably what is causing the problem. Have you got the website online so we can take a look?

Also if you are using a drop down menu then I would suggest using something similar to the one I use at Paramiliar Design Studios
__________________
Matthew Bagley
Paramiliar Design Studios
Who am I | Free Layouts |Website Development | UK SEO
Paramiliar is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Errors with Javascript
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11509 seconds with 13 queries