PDA

View Full Version : Top Navigation Bar III



ptrivilino
12-29-2004, 11:12 PM
http://www.dynamicdrive.com/dynamicindex1/topmen3/index.htm

I just modified the custom.js script file to use with my web site and checked my modifications using the template.html file provided by the developer. Everything works great as long as the template.html file is in the same folder as all of the scripts. When I move the template.html file outside of the folder containing the scripts, and update the paths in the HTML file to link with the script files, the menu does not appear on the page. Do the HTML file and script files have to be in the same folder to work? Can the scripts be modified so that the HTML file can be in a different location than the script files? I am hoping to organize my site by linking all of the pages to one location for the script files rather than duplicating all of the script files through out my site.

Thanks for the help,

Paul

rose_lady
12-29-2004, 11:38 PM
Also, what does it mean when I try to open custom.js and it says 'exclude' is undefined?

rose_lady
12-30-2004, 12:04 AM
Oops, sorry Paul...I meant to post this in my thread, not yours.

cr3ative
12-30-2004, 09:13 AM
@rose_lady: Do not try to open .js files - they don't work like that. Read the implementation instructions on how to get them working.

@Paul: How are you making the script see where the new file locations are? Are you using absolute (www.webhost.com/script/script.js) or relative (/script/script.js)?

cr3ative

ptrivilino
12-30-2004, 06:00 PM
rose_lady : No problem. It sound like you may be double clicking on the custom.js file to open it. That is probably why you are getting that error message. What you need to do is use a text editing program (not Word) to open the file. Once you open the file, save it as a new file, changing the name slightly (custom1.js), so you have a back-up of the original file. You will need to change the name of the link in your HTML file to match the name of your new script file.

cr3ative: I am using relative linking. To run the test, I have the script files in a folder called "navigation" and placed the folder in my root directory. The HTML file "template.html" is also in the root directory. I used relative linking to link the HTML file to the script files (i.e. <script type="text/javascript" language="javascript" src="navigation/sniffer.js">). Should I be using absolute linking?

Here are links to my files if you would like to examine what I did:
Located in the "navigation" folder: http://trivilinodesign.com/topmenu3/navigation/template.html
Located outside of the "navigation" folder:
http://trivilinodesign.com/topmenu3/template.html

Paul

cr3ative
12-30-2004, 06:29 PM
Yes, I would suggest trying to use absolute targeting. The code is implemented correctly, so I can only think that that is the problem.

Regards
cr3ative

ptrivilino
12-30-2004, 09:04 PM
Thanks for the suggestion, cr3ative. Unfortunately, it did not work. The file that is currently posted at http://www.trivilinodesign.com/topmenu3/template.html is the revised HTLM file using absolute links. Looks like I will have copies of the script files scattered through out my Web site. Such a waste of disk space. :(

Thanks for the help.

Paul