inserting explanation type info in file

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

inserting explanation type info in file

Post by Ruth »

I remember in version 3 the file had all kinds of info next to various things with // and such. Is it possible to do that in the new menu? I just need to have info there for my memory of what I did with certain things and why....not sure how to do that or if it's possible. Happy New Year, everyone.

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

Post by Maz »

Happy New Year Ruth!

I think you will be okay with //

I'm not having problems with it anymore.

maz
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Thanks Maz, worked perfectly.

Ruth
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Ruth and Maz,

Just to add... the explanations are held in "comments." Most programming/scripting languages offer the ability to add comments to the code, for just the reason you mention (remembering later what you did, or helping others to understand what you did). Since the menu code is javascript, you can use javascript's commenting scheme. In javascript, there are two methods of adding comments.

(1) If you want to add a comment on a single line in the .js file, you can use the // method, like so:

Code: Select all

var inkeeper9 = "Ruth"; // innkeeper9 is Ruth's on-line name
Everything to the right of the //, on that single line of code is ignored by the browser when it processes that line of js code.

(2) If you want to add a "block" of comments, i.e., more than a single line, you have two choices. Some people would add a // to the start of each line. Alternatively, you could use the /* put your comments here */ construct, like so:

Code: Select all

/*
Ruth and Maz both participate quite a lot on the Milonic forums,
asking questions occasionally, and also often answering other
people's questions to "give back" to this very nice on-line
community.
*/
var inkeeper9 = "Ruth";  // innkeeper9 is Ruth's on-line name
var maz = "Maz"; // Don't know what Maz's real name is
Everything between the opening /* and the closing */ is ignored, kind of like using <!-- and --> in html code.

Cheers,

Kevin
Post Reply