Object Expected Errors

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
SpeedStreet
Advanced
Advanced
Posts: 14
Joined: Sat Sep 20, 2003 7:34 pm

Object Expected Errors

Post by SpeedStreet »

Code: Select all

<!-- Begin Navigation -->
<script language="javascript" src="milonic_src.js" type="text/javascript"></script>	
<script	language="javascript" type="text/javascript"> 
//<![CDATA[ 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>
<!-- End Navigation -->
No other changes made to the code. The .js files are located in the root directory for testing purposes. Yet, the menu will not load, and in IE I am getting line 17 char 1758 object expected errors.

Being that the code is compressed and damned near impossible to read, I have no choice but to ask all of you for help.

Thanks!
SpeedStreet
Advanced
Advanced
Posts: 14
Joined: Sat Sep 20, 2003 7:34 pm

Post by SpeedStreet »

BTW - The above code snippet is complient with anyone who is interested in maintaining an XHTML 1.0 compliant website...so feel free to use if you like :D
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

Thank you, I wasn't sure about putting back cdata on xhtml template. Now if I can figure out the correct doctype...?

Have you considered the path before file names?
You could download a new menu and work from there.

Regards
maz
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Being that the code is compressed and damned near impossible to read, I have no choice but to ask all of you for help.
The code is compressed to save space and also keep people from messing with it too much. You make it sound like its a bad thing you are asking us. Sorry. :roll:

You are referencing your script files without anything in front of them, i.e. src="milonic_src.js", so this means the page is looking into the current directory that the page is in. So unless your page is also in the root, like you said your menu files are, then it won't work. They all have to be in the same directory.
//<![CDATA[ if(ns4)_d.write("<scr"+"ipt language=JavaScript
I am just catching on to the whole compliance thing, but inside of script tags, // means comment the line so doesn't this comment out this entire line? The above quote is contained within script tags.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
SpeedStreet
Advanced
Advanced
Posts: 14
Joined: Sat Sep 20, 2003 7:34 pm

Post by SpeedStreet »

The Cdata comment allows the code to pass through similarly to the whole commenting out of javascript from way back when.

The copy of the script was downloaded today, and it is 100% fresh.

As for the compression...I think its great! It's just a pain in the butt to work on when you have to debug it, but it is definitely a tradeoff I am willing to make :D


All files are currently in the same directory. Sorry about the vagueness of my last reply.
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

This is the original version 3, to compare:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>
Mercury Exposure
</title>
<link rel="stylesheet" type="text/css" href="template/main/style.css">
</head>
<body>


<script type="text/javascript" language="JavaScript">
//<![CDATA[
/*
Milonic DHTML Website Navigation Menu - Version 3.4

License number - 187570

Written by Andy Woolley - Copyright 2002 (c) Milonic Solutions Limited. All Rights Reserved.
Please visit http://www.milonic.co.uk/menu or e-mail menu3@milonic.com for more information.

The Free use of this menu is only available to Non-Profit, Educational & Personal web sites.
Commercial and Corporate licenses are available for use on all other web sites & Intranets.
All Copyright notices MUST remain in place at ALL times and, please keep us informed of your
intentions to use the menu and send us your URL.
*/
//]]>
</script>
<script language="JavaScript" src="template/main/menu_array.js" type="text/javascript"></script>
<script language="JavaScript" src="template/main/mmenu.js" type="text/javascript"></script>
SpeedStreet
Advanced
Advanced
Posts: 14
Joined: Sat Sep 20, 2003 7:34 pm

Post by SpeedStreet »

maz wrote:Thank you, I wasn't sure about putting back cdata on xhtml template. Now if I can figure out the correct doctype...?

Have you considered the path before file names?
You could download a new menu and work from there.

Regards
maz
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
This Doctype allows you to work in the transitional mode...so everything isn't as strict...but still compliant :D
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Notice how Maz had her //<![CDATA[ on a separate line from the rest of the code, I think you need to do that too. If you put //<![CDATA[ on a line and then start the java code, the entire line is ignored. You need to start the code on the following line. Am I right?
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

Thank you,
This is a big help getting xml correct.

The current RC is misbehaving,
I'm waiting on the next download.
Regards,
maz
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

That was funny, besides the fact my top menu doesn't align since the 15th, two text capital E's with hats perched themselves in the top left hand corner. see www

maz
SpeedStreet
Advanced
Advanced
Posts: 14
Joined: Sat Sep 20, 2003 7:34 pm

Post by SpeedStreet »

I should have pointed out that I have tried it without the XHTML markup....in fact, I tried it out of the box, and still had issues...
SpeedStreet
Advanced
Advanced
Posts: 14
Joined: Sat Sep 20, 2003 7:34 pm

Post by SpeedStreet »

As a test, I took the code from install, threw it in blank.htm (provided with Milonic Script) and it _still_ did not work. :(


It's being a little :evil:



:D
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

blank.htm is just something it needs on a secure server.
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Yeah I wouldnt throw it in blank.htm. Throw them in a different page. Also, you also installed the mmenudom and the mmenuns4 files in the directory too, right? Do you have a URL we could see? So we can see it not showing up as well as view your entire code?
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
SpeedStreet
Advanced
Advanced
Posts: 14
Joined: Sat Sep 20, 2003 7:34 pm

Post by SpeedStreet »

Sure thing.


I really appreciate all of the help you all are providing...next time I make cookies, you are on my list ;)

Here are the links to the pages:
http://www.speedstreet.org/newindex.php
http://www.speedstreet.org/testmenu.html
All js scripts are located in the root directory as well as /js/ (tried both for testing purposes

This is the first time I have ever posted this link public...let me know what you think :D
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

SpeedStreet wrote:As for the compression...I think its great! It's just a pain in the butt to work on when you have to debug it, but it is definitely a tradeoff I am willing to make :D
None of the compressed files are intended to be edited. The only file that does is menu_data.js (or whatever you have named it).
John
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

You don't have the calls to the rest of the menu code on this page...

Code: Select all

<script language="javascript" type="text/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>
John
SpeedStreet
Advanced
Advanced
Posts: 14
Joined: Sat Sep 20, 2003 7:34 pm

Post by SpeedStreet »

Whoops...

I tried removing that to see if that would help...

dropped it back in...still nothing.

Sorry bout that.
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

Went to http://www.speedstreet.org/testmenu.html and viewed the source and all I saw was

Code: Select all

<html><body>
<script language="javascript" src="milonic_src.js" type="text/javascript">
</script>	
<script language="javascript" src="menu_data.js" type="text/javascript">
</script>
</body></html>
You're not specifying mmenudom or mmenuns4 at all. As John said your js includes need to look like this....

Code: Select all

<script language="javascript" src="milonic_src.js" type="text/javascript">
</script>
<script language="javascript" type="text/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>
I could have sworn you almost had it the first time around, but that CDATA stuff with the comment thing I swear was screwing it up.
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

My guess is it needs a slash for the path /menu.js
Post Reply