Google Answers Logo
View Question
 
Q: Javascript Error message ( Answered 5 out of 5 stars,   1 Comment )
Question  
Subject: Javascript Error message
Category: Computers > Programming
Asked by: paulfromwestwales-ga
List Price: $10.00
Posted: 12 May 2004 07:57 PDT
Expires: 11 Jun 2004 07:57 PDT
Question ID: 345127
Every page on a web site I am updating  for a friend is showing errors
with a javascript menu system bought from http://www.ibswebdesign.com
(PopOutTextMenu: v1.2) by the previous developer.

My AceHTML5 editor states:
[Warning] index.html (70): javascript: Illegal class name "POTMenu".
[Warning] index.html (70): javascript: ";" expected.


Example web page:
http://www.costadelaluz.biz/index.html
Javascript source at:
http://www.costadelaluz.biz/popouttext.js

I know its probably something simple, but I lack the knowledge to sort it out.
Previously it was showing errors on every javascript code line:
[Warning] index.html (every line): javascript: ";" expected
I simply added a ";" at the end of each line which seems to have
solved it, bar the first line which gives the above error messages.
This strikes me as odd for a commercially produced template, or is my
ACEHTML5 Pro checker simply being overstrict in its definition of an
error?

It doesn't seem to stop correct operation of the menu system, but it
is the persistant error message that has got under my skin!
OK, OK, I realise I am turning into the web equivalent of a hypocondriac!
Answer  
Subject: Re: Javascript Error message
Answered By: aceresearcher-ga on 12 May 2004 09:25 PDT
Rated:5 out of 5 stars
 
Greetings, Paul!

I know *exactly* what you mean! When I encounter something like this,
even if there's a viable workaround, I *still* persist in working on
the error until I have hunted down the solution. So, I'd be going
crazy, too.

A View --> Source reveals the following chunk of code in the html for
http://www.costadelaluz.biz/index.html:

------------------------------------------------------
<script language="JavaScript1.2">
mymenu = new POTMenu;
// Defines the size of the main menu items, width and height

mymenu.mainmenuitemsize(140,35);
 . . .
 . . .
 . . .
// This line is required after all menu definitions are finished

mymenu.showMenu();

</script>
------------------------------------------------------

This is code generated by the PopOutTextMenu software.

Try changing:
mymenu = new POTMenu;
to
mymenu = new POTMenu();

(strict Javascript wants to see those parentheses!)

and see if that doesn't fix up your problem.

Before Rating my Answer, if you have any questions or problems with
the above information, please post a Request for Clarification, and I
will be glad to see what I can do for you.

I hope that this Answer provides exactly the information that you were seeking!

Regards,

aceresearcher

Request for Answer Clarification by paulfromwestwales-ga on 12 May 2004 14:10 PDT
I thought your answer was eminently sensible and altered my coding -
to no effect! Still the identical error. added space (); - no luck. I
then thought should I add it after mymenu as well ie mymenu()= new
Potmenu(); no effect. Tried a different set of {} also to no effect.

This where a $10 question turns into a $300 one in terms of time!
Please don't spend hours on it - it is a nuisance rather than a
necessity.

Paul

Clarification of Answer by aceresearcher-ga on 12 May 2004 14:15 PDT
Paul,

Well, now I am really annoyed.

Is AceHTML5 one of those that can display error messages in-line in
the code to show exactly where they occur? If so, can you post a chunk
which includes a few lines before, the error messages, and a few lines
after?

Thanks,

ace

Request for Answer Clarification by paulfromwestwales-ga on 12 May 2004 15:50 PDT
The short answer to that is no. Normally I split a long line in HTML
fault finding into different lines at natural "breaks" to help the
checker to pinpoint things. Here there is not much to split! If you
split this at the =, the error purely follows new POTmenu();

Line 65 <script language="JavaScript1.2" src="popouttext.js">
Line 66 </script>
Line 67 <script language="JavaScript1.2">
Line 68 mymenu = new POTMenu();
Line 69 // Defines the size of the main menu items, width and height
Line 70
Line 71 mymenu.mainmenuitemsize(140,35);
Line 72
Line 73// Defines the size of the sub menu items, width and height

line 75 mymenu.submenuitemsize(190,19);
and so on!

Error message is just a line one, not an inline one
[Warning] index.html (68): javascript: Illegal class name "POTMenu".
[Warning] index.html (68): javascript: ";" expected.

I have now put this message as a remark against line 68 on Index.html
to show you that your suggested alterations have been made -
hopefully, exactly as you proposed.

Thanks for still trying. Don't get too hooked and make it uneconomic for yourself.

Paul

Clarification of Answer by aceresearcher-ga on 12 May 2004 23:50 PDT
Paul,

I ran the html code for this page through Dreamweaver MX -- which is
pretty finicky -- and got no errors or warnings at all. However, it
had an absolute conniption fit over the javascript code in
popouttext.js.

PopoutTextMenu generates code in Javascript 1.2, a version which has
been superseded by later versions; furthermore, while the Netscape
browser uses Javascript, IE uses Microsoft's special version, called
JScript.

From "Essential JavaScript" by Steven Holzner (New Riders, 2002-03):
"So now we actually have three standards: JavaScript, JScript, and
ECMAScript. Although ECMAScript has brought some measure of coherence
to the picture, both browsers also have gone their own ways. The
result is that the Internet Explorer often has two ways of letting you
do things (the JScript way and the ECMAScript way), and the Netscape
Navigator has two ways of letting you do things (the JavaScript way
and the ECMAScript way). A big problem was that ECMAScript
standardized the core JavaScript language itself, but not all the
resources available in browsers that you work with?and those resources
make up a much larger field than the JavaScript language does by
itself."
http://www.informit.com/articles/article.asp?p=29977

So, depending on how well the PopoutTextMenu programmers have
programmed for various browsers and various script versions, I think
it is highly likely that they're doing something in a way that has
been deprecated ( http://en.wikipedia.org/wiki/Deprecated ), and that
the programmers for ACEHTML5 have implemented newer and/or different
standards than those used by PopoutTextMenu.

I believe that these so-called "error messages" may in fact just be
ACEHTML5 (a **great** name for a program! ;=) flagging an outdated
construct in the PopoutTextMenu code.

ace
paulfromwestwales-ga rated this answer:5 out of 5 stars
Fantastic amount of research for $10! The answer was difficult to
find, but Ace lived up to his name and tracked down a logical reason
for the problem.
My first experience of Google Answers - encourages me to return. Well Done!

Comments  
Subject: Re: Javascript Error message
From: aceresearcher-ga on 13 May 2004 02:37 PDT
 
Thanks for the excellent Rating and glowing remarks, Paul. I do enjoy
programming and playing detective (at least the nice 5 minute rush I
get when I figure something out, if not the hours preceding that which
I spend banging my head against the keyboard).

By the way, I'm a she, if that's okay. But since my father didn't get
the sons he wanted, I'm pretty much a tomboy. ;=)

Best wishes,

ace

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy