Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:17
How do you begin?
Poster: Surfergirl
Dated: Saturday August 23 2003 - 20:20:33 BST
Hullo
I'm script-challenged - I learn from copying other stuff. What has me stumped is I downloaded some files but I don't know what to type in the body to call them up - there is a mmenudom.js, menu_data.js, milonic_src.js , menuns4.js
I think you put this on the page :
<script language=JavaScript src="/images/menu/milonic/milonic_src.js" type=text/javascript></script>
<script language=JavaScript src="/images/menu/milonic/menu_data.js" type=text/javascript></script>
but nothing comes up - I just want to see the sample I downloaded from Milonic appear on my page.
I put the script path in
//scriptpath="/images/menu/milonic/";
Poster: Maz
Dated: Saturday August 23 2003 - 21:37:09 BST
After downloading the menu, do nothing, open the menu.htm file in your browser. It will appear. Then you can begin by opening menu_data.js and try changing text=YOUR LINK NAME and read more instructions on the website to begin changing the menu.
Everything between
aI("...............");
is a menu item
After the top 8 styles are main menu styles.
ending
}
Followed by styles for submenus.
ending
}
A menu may have its own style.
A menu item may have its own style.
Start slow changing items, save and preveiw in your browser, if you do it wrong the menu won't appear... undo last save.
Read instructions on the site, and search the forum if you run into problems.
When you are ready to put the menu up, then place the script on your page where you want the menu to appear.
Poster: Surfergirl
Dated: Saturday August 23 2003 - 21:43:12 BST
Part I
Ok, I conceeded and moved everything into the main directory and it works but that won't solve my problem when I start adding folders. I need help with the dir structure. I tried putting in the url and that didn't work. This file is in http://www.adventurescape.com/HortonRea ... nu/milonic - please tell me what to do for the src and the call files
Part II - If I change only one letter on the menu_data.js from the download example it gives 'done but with errors on the page'
this is driving me mad the wind is blowing and I want to go surfing
Poster: John
Dated: Sunday August 24 2003 - 0:53:35 BST
You havent set the scriptpath to point to the directory the menu files are in.
Quote:
Part II - If I change only one letter on the menu_data.js from the download example it gives 'done but with errors on the page'
Given how many letters there are in that file, would you like us to try and guess which you changed one by one, or would you like to give us more exact information on what exactly is happening?
We are more than willing to help, but you have to do your part, too.
Poster: Surfergirl
Dated: Monday August 25 2003 - 20:17:04 BST
Thanks - I figured out that I was not saving it in the proper format and that is what gave the error - I feel real stupid.
I would like some help with the directory paths though - I've read everything on the forum and I still don't get it. I have all this in a temp location until we go live so will hve to change it all again - but I need a lesson in directories pretty please...
http://www.adventurescape.com/hortonrea ... nu/milonic ...
Poster: Surfergirl
Dated: Monday August 25 2003 - 21:07:08 BST
For the script src I put : http://www.adventurescape.com/HortonRea ... u/milonic/
I can get to the script on the web at the same address
The menu still isn't coming up on the page .....
But if I put it in the root directory, on the same level as the main index.htm page, without any src it works. I prefer to have it in its own little folder.
Poster: Maz
Dated: Tuesday August 26 2003 - 1:16:12 BST
If you weren't out surfing, you might have read to rem the 2 surfboards "//"
Poster: Surfergirl
Dated: Tuesday August 26 2003 - 13:45:06 BST
Maz, I'm not a scripter - what do you mean rem //? I need it spelled out - I'm not catching your wave
Poster: John
Dated: Tuesday August 26 2003 - 15:29:55 BST
Your acriptpath in milonic_src.js is wrong AND it's not being read at all because it is commented out (//). It should look like this...
Code:
scriptpath="/HortonRealty/images/menu/milonic/";
Poster: Surfergirl
Dated: Tuesday August 26 2003 - 17:49:12 BST
Thanks for the pointers -
I took out the // - script path is now /HortonRealty/images/menu/milonic
Tried 2 ways on the web page - with the absolute path http://.... and the relative path /images/menu/milonic/milonic_src.js - hate to say - neither one pulls up the menu - yikes - I know this works because I saw it work when I had everything in the main directory - all I did was change the paths
while I have your attention - what are the other 2 files in the download for ? mmenudom.js and mmenuns4.js? just curious
Poster: John
Dated: Tuesday August 26 2003 - 18:21:35 BST
Surfergirl wrote:
I took out the // - script path is now /HortonRealty/images/menu/milonic
Which is incorrect Check my earlier message again. You left out the closing / (which is also mentioned in Andy's notes in the milonic_src file itself ).
Surfergirl wrote:
while I have your attention - what are the other 2 files in the download for ? mmenudom.js and mmenuns4.js? just curious
They are both part of the overall menu code and had better be on your server in the same location as milonic_src Specifically, the first is called for use by newer browsers, and the second for older Netscape browsers.
Poster: Surfergirl
Dated: Tuesday August 26 2003 - 18:44:05 BST
Hi John
the last / is on the script - I didn't type it on the forum. I'm getting 'done with errors'
Poster: John
Dated: Tuesday August 26 2003 - 19:05:52 BST
Surfergirl wrote:
the last / is on the script - I didn't type it on the forum. I'm getting 'done with errors'
Yep, and you will until you take that miserable // off the front of scriptpath You made the other changes there, but not that one.
You still have...
Code:
//scriptpath="/HortonRealty/images/menu/milonic/";
Should be...
Code:
scriptpath="/HortonRealty/images/menu/milonic/";
We really need to have a long chat...
Poster: Surfergirl
Dated: Tuesday August 26 2003 - 19:14:18 BST
would you believe I'm blonde?
its still having a problema - will you still help?
Poster: John
Dated: Tuesday August 26 2003 - 19:30:43 BST
Surfergirl wrote:
:oops: would you believe I'm blonde?
Sure Would you believe I'm old Shows sometimes, like now.
Try this. Drop the /HortonRealty off the front end of the scriptpath so it looks like this...
Code:
scriptpath="/images/menu/milonic/";
Poster: Surfergirl
Dated: Tuesday August 26 2003 - 19:41:26 BST
sorry I'm giving you gray hair - I've stripped the whole src file down, bare-naked, took off every little /* at the top - it begins like this:
scriptpath="/images/menu/milonic/";
_mDepth=2;
_d=document;_\...............etc etc
Poster: John
Dated: Tuesday August 26 2003 - 19:47:46 BST
Surfergirl wrote:
sorry I'm giving you gray hair - I've stripped the whole src file down, bare-naked, took off every little /* at the top - it begins like this:
BAD idea. What you've done is remove all Andy's required copyright info and notes, and possibly other required code as well. Touch only the scriptpath line.
Get a fresh copy of that file (do NOT try and piece it back together), and edit only scriptpath.
Poster: Surfergirl
Dated: Tuesday August 26 2003 - 20:01:23 BST
yikes ! sorry - - ok, brand new copy - looks like
Non profit use of this menu system is free of charge. All Copyright statements must always remain in place
******* PLEASE NOTE: THIS IS NOT FREE SOFTWARE, IT MUST BE LICENSED FOR ALL USE *******
License Number: Un-Licensed
*/
scriptpath="/images/menu/milonic/";
/*
The scriptpath variable stores the path to your menu JS files.
etc.....
Poster: John
Dated: Tuesday August 26 2003 - 20:31:00 BST
Noticed you posted RC8 of milonic_src (BTW, where did you get that version), but the other files are still RC7. Not good to mix.
Poster: Surfergirl
Dated: Tuesday August 26 2003 - 20:36:25 BST
I just downloaded it from milonic site - which is the same download area I got the other files about 3 days ago. I've changed it all to the newer files - still with errors... BTW - thanks for all your help !
Poster: Hergio
Dated: Tuesday August 26 2003 - 21:56:22 BST
May I butt in here, you have all the source files in a directory together, thats great. But you are not referencing them from the page correctly. Heres what your page says...
Quote:
<script language=JavaScript src="/images/menu/milonic/milonic_src.js" type=text/javascript></script>
<script language=JavaScript src="/images/menu/milonic/menu_data.js" type=text/javascript></script>
<script language=JavaScript src="/images/menu/milonic/menu_data.js" type=text/javascript></script>
When your files are actually located at /HortonRealty/images/menu/milonic/ ...so change that first. THen your milonic_src is still wrong, it should be EXACTLY
scriptpath = "/HortonRealty/images/menu/milonic/";
And John, just to clarify, but now I am second guessing myself, but because shes starting the script path off with a / that means its starting from the root (.com) so she needs the HortonRealty/, right? Your on the right track surfergirl, we'll get you there.
Poster: Surfergirl
Dated: Tuesday August 26 2003 - 22:16:36 BST
It worked!
I don't believe it. You know why ? When I had the files working in the main directory, then moved them, DW made the change to /images/menu/milonic/etc.js I figured that it was correct. Never in a million years would I have put /HortonRealty/ in front of that.
So, are you saying that if I put the menu on a different page that is inside a subfolder like /HortonRealty/Listings/Residential/index.htm I keep the path to the script on that page /HortonRealty/images/menu/milonic/etc.js ?
Poster: John
Dated: Tuesday August 26 2003 - 22:18:38 BST
Yes, more gray hair.
I set up a dup of your site on my server and can't get it working here, either (but the page is loading with no JS errors!).
Need to do some more digging.
Poster: Hergio
Dated: Tuesday August 26 2003 - 22:25:35 BST
Yes surfer girl , thats exactly it. That path will work from anywhere because you are always starting from the root (hence the / in the beginning). To make my life easier, I tuck all my includes away in a nice well kept directory and then I create a virtual directory to them (called inc), so ANYWHERE on my site I can reference all my includes with a simple little oneliner like... <script src="/inc/menu_data.js"></script> even though my menu_data is like 5 levels down. works for me!
Poster: John
Dated: Tuesday August 26 2003 - 22:46:27 BST
Yes, exactly correct, Dave. It's been a zoo here already this week with the first day of classes yesterday, on top of which we moved folks into our first ever for this campus dorms on Saturday.
So, the ol' crossed eyes missed the root of the page. But then, it did take a while to get her to remove the dang // from in front of scriptpath
Poster: Surfergirl
Dated: Tuesday August 26 2003 - 22:47:16 BST
Thanks Hergio and Maz and big kudos to John - Someday I'll be such a wiz I can return the favor.
I'm not totally understanding how it works - it's not following the same logic for file structure that I learned way back when ../../file.htm
And throw in another loop when you say 'virtual directory' is only 1 directory down when the file is really 5 directories down... can you explain it in layman terms, web design 101? Reason is I'm going to have to move the whole thing again....scary eh?
Poster: Surfergirl
Dated: Tuesday August 26 2003 - 22:50:18 BST
yeah but the script came with the // already installed !
Poster: John
Dated: Tuesday August 26 2003 - 23:06:25 BST
Surfergirl wrote:
yeah but the script came with the // already installed !
Yep, because the new file didn't have anything filled in for scriptpath, and also it is possible that, depending on the setup, a value might not be needed there. In your case it was needed, so that line had to be un-commented (i.e., remove the //). Commented lines (//) are ignored entirely, so even earlier when we (finally) had the path correct, the line was ignored because of the //.
Poster: John
Dated: Tuesday August 26 2003 - 23:16:56 BST
Surfergirl wrote:
And throw in another loop when you say 'virtual directory' is only 1 directory down when the file is really 5 directories down... can you explain it in layman terms, web design 101? Reason is I'm going to have to move the whole thing again....scary eh?
Dave's explanation was good and right on. "1 directory down" is the way it appears, obviously not the way it really is. It's called server relative addressing (the leading / and the path we set up tells us that). As long as you don't change that structure you can add anything else you like with no problems.
Unlike this, if you code using ../../images/a.gif, and then move that page to a different level, you've got a problem, since the above example backs up 2 directories from its current level. Wherever it is it's going to back up the same amount. At some point it won't find what it's looking for. In addition, you've got to code differently depending on the level the page is on - ../images, or ../../../images, etc. Royal pain.
Poster: Surfergirl
Dated: Tuesday August 26 2003 - 23:29:50 BST
So a virtual directory has a leading / in front of the path from the root level, that's vd? Thanks again John, sorry to mess up your hair
Poster: Hergio
Dated: Wednesday August 27 2003 - 3:39:54 BST
I dont want to get too technical with ya, but basically starting a path with a / just means to begin at the root. And generally virtual directories are in the root to make things easier, thats their whole point. SO you usually refer to virtual directories like /virtualDir/......
A virtual directory is basically just a 'made-up' mapping (usually easier) onto a real directory. So I could have my menu js files in ...com/includes/milonic/v5/menu/sources/ directory, but thats just a mouth full so I can tell the server, 'hey, whenever I say "/menu/" I want you to think "/includes/milonic/v5/menu/sources/", got it server?' This just makes life alot easier, and technically there is no /menu/ directory in the root, but virtually there is because the server will swap in the longer mapping. And another great thing about them is, the files you want the virtual directory to point to dont have to be inside the wwwroot directory, they could be in your My Documents folder for example. They give you the ablility to publish things to the web without having to move them over to the wwwroot directory. (BTW, wwwroot is the default directory on MS servers for the root of the web directory)
And the slash before a directory, as I said tells the server to start looking for these files beginning from the root...no matter where the page may exist in the directory structure. Like John said, the ../../ gets crazy because its all relative. You move the file that says ../../ to another directory, and ../../ could mean a totally different thing. /menu/ will always means the same thing no matter what directory I say it from.
Whew, class dismissed!
ADDENDUM - Got it John!
Poster: John
Dated: Wednesday August 27 2003 - 3:43:12 BST
Actually I wasn't talking about a 'real' virtual directory (every one of my Student Affairs directories is such - tons of 'em), but was just using the term in the context of that discussion.
Poster: fredlongworthhighschool
Dated: Wednesday August 27 2003 - 9:14:18 BST
I think the best way to start is just with your files in one folder. Have your home page and the JS files all together, and the little down and right arrows.
Get your site working and then start to organise things into folders. All you have to do is add one "/" or miss one out or get confused with ".." and you're stumped.
Poster: Surfergirl
Dated: Wednesday August 27 2003 - 13:44:29 BST
Thanks Dave - that was great info, I have seen you explain exactly that before in the forum - its starting to sink in - educators always repeat the explanation 3 different ways to make sure even the slowest learners finally catch on....
Poster: Maz
Dated: Wednesday August 27 2003 - 17:28:32 BST
Hergio wrote:
To make my life easier, I tuck all my includes away in a nice well kept directory and then I create a virtual directory to them (called inc), so ANYWHERE on my site I can reference all my includes with a simple little oneliner like... <script src="/inc/menu_data.js"></script> even though my menu_data is like 5 levels down. works for me!
I'm learning the zen of php through the transition of volunteers, so this must be the equivalent to index.php. I must check into this. Here is the scenerio, my site got launched and the under development page came down, couldn't figure out how, instead I set up .htaccess, then my links didn't work without including index.php, now when the site is launched I'll have to change all the links back. I must locate the original script.
Thanks for the tips,
maz