View Full Version : Not imortant but for my learning.

07-04-2005, 01:52 AM
I know this isn't very important, but in the script below, why are the object stated twice?(highlighted) throughout the whole script. I am just trying to understand the script a little better, so if you know hit me up! :cool:

menu = new Menu();
menu.addItem("webmasterid", "Web Building Sites", "Web Building Sites", null, null);
menu.addItem("newsid", "News Sites", "News Sites", null, null);
menu.addItem("freedownloadid", "Free Downloads", "Free Downloads", null, null);
menu.addItem("searchengineid", "Search Engines", "Search Engines", null, null);
menu.addItem("miscid", "Miscellaneous", "Miscellaneous", null, null);

menu.addSubItem("webmasterid", "Dynamic Drive", "Dynamic Drive", "http://www.dynamicdrive.com/", "");
menu.addSubItem("webmasterid", "JavaScript Kit", "JavaScript Kit", "http://www.javascriptkit.com/", "");
menu.addSubItem("webmasterid", "Web Review", "Web Review", "http://www.webreview.com/", "");
menu.addSubItem("webmasterid", "Freewarejava.com", "Freewarejava.com", "http://www.freewarejava.com/", "_blank");
menu.addSubItem("webmasterid", "Web Monkey", "Web Monkey", "http://www.webmonkey.com/", "_blank");

menu.addSubItem("newsid", "CNN", "CNN", "http://www.cnn.com", "");
menu.addSubItem("newsid", "ABC News", "ABC News", "http://www.abcnews.com", "");
menu.addSubItem("newsid", "MSNBC", "MSNBC", "http://www.msnbc.com", "");
menu.addSubItem("newsid", "CBS news", "CBS News", "http://www.cbsnews.com", "");
menu.addSubItem("newsid", "News.com", "News.com", "http://news.com", "");
menu.addSubItem("newsid", "Wired News", "Wired News", "http://www.wired.com", "");
menu.addSubItem("newsid", "TechWeb", "TechWeb", "http://www.techweb.com", "");

menu.addSubItem("freedownloadid", "Dynamic Drive", "Dynamic Drive", "http://www.dynamicdrive.com/", "");
menu.addSubItem("freedownloadid", "Download.com", "Download.com", "http://download.com/", "");
menu.addSubItem("freedownloadid", "Tucows", "Tucows", "http://tucows.com/", "");

menu.addSubItem("searchengineid", "Yahoo", "Yahoo", "http://www.yahoo.com/", "");
menu.addSubItem("searchengineid", "Google", "Google", "http://www.google.com/", "");
menu.addSubItem("searchengineid", "Excite", "Excite", "http://www.excite.com", "");
menu.addSubItem("searchengineid", "HotBot", "HotBot", "http://www.hotbot.com", "");

menu.addSubItem("miscid", "Cnet", "Cnet", "http://www.cnet.com/", "");
menu.addSubItem("miscid", "RealAudio", "RealAudio", "http://www.realaudio.com/", "");
menu.addSubItem("miscid", "MP3.com", "MP3.com", "http://www.mp3.com/", "");


07-04-2005, 04:45 AM
My guess is that they represent two different parameters that in each case, in this example, the author chose to be the same. For instance, one could be 'text to display' and the other could be 'title text for mouseover tip' (similar to behavior of the the alt attribute in IE with images). It has been my experience that these menus that have this sort of configuration syntax also come with well commented configuration files that explain this and much more. There usually is also an extensive tutorial page in the distribution that covers the options in greater detail.

07-04-2005, 05:04 PM
After running a few tests, the first is the text to be displayed, and the second is the hint or description that is revealed when mouse hovers.

07-04-2005, 05:29 PM
A.K.A. the tooltip.