Click to See Complete Forum and Search --> : Simple text side menu with external .js script
David_LL
12-21-2002, 06:28 AM
Hello...
I am a newby to java scripting, so please go easy on me!
I need a java script, a simple side border text links menu that reads off of an external .js script, so that my entire site will read from this one .js menu, and when I need to make link changes, all i have to do is edit the .js menu and the entire site is taken care of.
Can anyone please point me to a scirpt that does this?
Unfortunately, it would need to be a pre-written script, my capabilities are limited to simply editing some of the text in the scripts.
Thanks!
Charles
12-21-2002, 06:35 AM
Currently about 12% of users do not use JavaScript. What you propose will make your site un-usable for an awful lot of people. Instead, you need to 'include' the menu at the server. Save the menu part of the HTML in a separate file and then call your server people to find out how to include the one in the other. This will be specific to the particular server that you are using.
David_LL
12-21-2002, 06:51 AM
That's a great suggestion. I hadn't thought of those who do not use java, or who keep it turned off or whatever...
I have already sent an e-mail to my server company explaining what I need to accomplish, and hope to hear back from them soon.
Thanks!
David_LL
12-21-2002, 07:50 AM
Unfortunately, I am getting nowhere fast. My server company responded with this:
Whether it be css, style sheet, ssi, php, or perl the server is standard Apache running on RedHat with perl, mysql, and php (as well as other less popular languages like python). So there are no special commands or configurations involved. If you run a command that seems right to you and produces an error then let us know what that error is and we'll help you out if it's a server specific issue. If you want to know if a certain software is installed we'll also be happy to answer that question.
So what exactly is the format, or style of what I am trying to accomplish?
Would the side border menu of text links be called up via a server side inlude?
Thank you, anyone who can answer :confused:
Charles
12-21-2002, 07:59 AM
What a bunch of jerks. Since they're running Apache, let's asume that they've got the thing configured in the usual way. Upload the fragment of HTML that you want to include and name it menu.html or anything else that you might like. Then put the following in the other file where you want the fragment included:
<!--#include virtual="menu.html" -->
Put the two in the same directory just to make things easy but you will need to name that second file, the one with the include instruction, with a shtml extension. Give that a try and let us know how it turns out.
David_LL
12-21-2002, 08:22 AM
Well how simple was that!? Man oh man... can't get any easier than that, and it works like a charm!
Thank you so much Charles! :rolleyes: :D
Charles
12-21-2002, 08:27 AM
I'm glad to be of some use. Now, if you are going to use a navigation bar then it's very important that you read the booklet at http://diveintoaccessibility.org/ and especially the chapter at http://diveintoaccessibility.org/day_11_skipping_over_navigation_links.html. And see http://httpd.apache.org/docs/mod/mod_include.html for an outdated list of some more cool things that you can do with the Apache server.
David_LL
12-21-2002, 08:41 AM
That's a great resource Charles... I have added it to my favorites, and will study it and refer to it often :)
I hope others will see this thread, who are beginners like me. I thought this would be a bunch of complicated code and a big hassle, when all along the answer was in SIMPLE html coding. .... back to the basics ...