line 17, char 1763, object expected

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
pat@dracoblu.com
Super Advanced
Super Advanced
Posts: 69
Joined: Sun May 19, 2002 7:23 pm
Contact:

line 17, char 1763, object expected

Post by pat@dracoblu.com »

I have downloaded the latest candidate 10, and the menu does not load when the page first appears. Upon refresh I am getting the following error:

line 17, char 1763, object expected

Any help would be appreciated ASAP - I am without a menu and copied over my candidate 9 file.

http://www.dracoblul.com

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

Post by Hergio »

Your link was bad, but I figured out its http://www.dracoblu.com

Your problem: you are missing a double quotes in your second script reference around the word javascript. I can't stress enough to just copy and paste the code from the install doc, the quotes won't hurt the page if they are missing. See your code below and notice the missing ending double quote.
<script language="javascript" src="milonic_src.js" type="text/javascript"></script>
<script language="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>
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
pat@dracoblu.com
Super Advanced
Super Advanced
Posts: 69
Joined: Sun May 19, 2002 7:23 pm
Contact:

Post by pat@dracoblu.com »

Thanks so much....Sorry for the inconvenience.
User avatar
Hergio
Milonic God
Milonic God
Posts: 1123
Joined: Wed Jun 12, 2002 7:46 pm
Location: Rochester, NY

Post by Hergio »

no inconvenience, I was just in one of those moods late last night, real tired, ya know? It always helps to have a fresh pair of eyes look over one's code because you can miss the smallest of things, trust me, I know first hand. Countless sleepless nights coding has shown me to rely heavily on others proofing my syntax once in a while. ;)
Dave Hergert
Software Engineer
"Helping to make the menu better, one :?: at a time."
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Hergio wrote:...the quotes won't hurt the page if they are missing.
Actually, some of the "upper level" HTML versions (XHTML, XML, etc.) are getting finicky about that. Things like border=0, type=text/javascript, etc., (note no quotes) are going to fail the checkers as folks try to move up the ladder. Everything now needs quotes.
John
pat@dracoblu.com
Super Advanced
Super Advanced
Posts: 69
Joined: Sun May 19, 2002 7:23 pm
Contact:

Post by pat@dracoblu.com »

You are correct, John. The script as it stands now is not W3C XHTML compliant. Apart from the quotes, the "<scr" is being misunderstood as an attribute. I have advised Andy.

Pat
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

pat@dracoblu.com wrote:You are correct, John. The script as it stands now is not W3C XHTML compliant. Apart from the quotes, the "<scr" is being misunderstood as an attribute. I have advised Andy.
Good catch, Pat. I think this is the problem. Now it is...

Code: Select all

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>");
Don't we need to quote the other attributes?
John
pat@dracoblu.com
Super Advanced
Super Advanced
Posts: 69
Joined: Sun May 19, 2002 7:23 pm
Contact:

Post by pat@dracoblu.com »

I think the best solution is to call the .js from a separate file and take it out of the HTML document altogether. This is what I have done for now until I hear from Andy (see http://www.dracoblu.com). As you mentioned, even calling a .js file has to follow strict guidelines to include quotes and specification of file type like the following:

<script language="javascript" src="milonic_src.js" type="text/javascript"></script>
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

I use include and cfinclude for mine (as I'm getting them re-written). Lots easier in many ways.
John
Post Reply