Need some help with JavaScript

Wetling23

Senior member
Aug 18, 2001
496
0
0
I've got two scripts. The first one is a simple javascript and the second is slightly different. For instance, the first is script type=text/javascript and the second is id=clientEventHandlersJS. To call the first, I added a document.write tag to the front of every line and the script type=text/javascript src=menu.js to the HTML document where I want the script to appear. Can I do the same thing with the second script too? The first script is here and the second is here.

I've got a couple of other questions about this thing, but this is the most important right now.

Thanks for your feedback.
 

Chebago

Senior member
Apr 10, 2004
575
0
0
marcyes.com
I could probably help you but I am not completely sure I understand the question, another thing, after looking at the script, you might want to try a different approach as creating a whole bunch of html code with javascript doesn't degrade graefully, meaning that if the visitor doesn't have js enabled, they won't see any of it...if you could explain the what you need a little bit more I'll see if I can help, good luck...
 

Wetling23

Senior member
Aug 18, 2001
496
0
0
Okay, I'll try to be more precise.

If you visit wetling.com, you'll see a green bar along the top. On the right side of the green bar are some links. I want to change some of those links so that when someone mouses over or clicks on certain ones, they get a drop down menu. For instance, for the one that says "Recipies", I'd like a the menu to take them to either beef, fowl, seafood, or dessert. Similar to this site.

Because one of the drop down menus would be for "Pictures", I expect to have to change it regularly (whenever I add a category). I'd like to create a file that I can call from each page so that only have to make the changes once.

What do you suggest?
 

torpid

Lifer
Sep 14, 2003
11,631
11
76
Uh... I don't understand why you need any sort of document.write anything. Also, as for not duplicating code, do you not have the ability to use SHTML includes? Is this just so you can learn how to do drop down menus or do you really expect it to be useful to people?

What is the story with the two scrolling frames, BTW? That's just icky.
 

Wetling23

Senior member
Aug 18, 2001
496
0
0
mAdMaLuDaWg, I did a search as you suggested, but I'm confused. Everything I've seen so far uses javascript files to get the job done.

torpid, I don't know what SHTML includes you're talking about. The purpose is to both learn and to be useful. There are people who visit the site regularly so I want to make navigation as easy as possible. As for the scrolling frames, those aren't gonig to be there anymore (soon).
 

Wetling23

Senior member
Aug 18, 2001
496
0
0
I've been playing around with a script that should do the job (though I'm open to better alternatives). So now I've got three that I'm calling but they're appearing in the wrong order. I call the original one first so that "Wetling.com" will be at the top and on the left. Then I call the other two (which go together), but when you view the page, the navigation bar is above the title bar (for lack of a better term). What gives?
 

Chebago

Senior member
Apr 10, 2004
575
0
0
marcyes.com
you definitely do not have to ever use document.write...if your script has that then scratch it and find a different one, you should be able to have all the links there, and then just use javascript to show or hide the list as appropriate, to demonstrate what I mean, click on my site in my sig and click on the about link, you can do something like that in your navigation but have it hover and stuff, there is a good script that I like that does the menus but I am on my work computer right now, I will find it and give you the link when I am home, good luck...
 

Chebago

Senior member
Apr 10, 2004
575
0
0
marcyes.com
here is the link

these are the best menus I have seen and I think I'm pretty sure this guy is an active AT forum reader because I think I found his sight through his sig, but his menus are really good and would be worth imitating. I don't remember his AT name, but he deserves all credit, good luck...