PDA

View Full Version : Problems separating out js and css from code on Dynamic Drive



DreamGirlB
06-18-2006, 03:06 PM
The following link has all the necessary code to make tab menus:
http://www.dynamicdrive.com/dynamici...ddtabmenu2.htm

My problem is instead of having it all in one document I want to break it up into three documents:
test2.html
top_nav.css
nav.js


I was able to successfully take the css code and break it into its own file.. but am unable to take the javascript and have it work in its own file..

If the css is broken out into its own doc.. and javascript stuff stays in the file.. it still works! can someone please take a look at it? I've attached the three files. (for the .css and .html) you'll have to take the .txt. This really shouldnt be hard.. what am I missing?

I posted this twice after finding out this question is better posted here. I'm sorry about that, I'm a newbie.

Twey
06-18-2006, 03:20 PM
Remove the </script> tag from the end of the JS file.
Also, the credit must go between the <script></script> tags on your page, not in an external file, according to DD's terms.

DreamGirlB
06-18-2006, 05:03 PM
I took out the </script>
that didnt help
I'm not understanding whatyou said about the things that go between <script> </script>

are you saying its not possible to move some of this to a java script file?

DreamGirlB
06-18-2006, 05:06 PM
Wait, I think it worked.. I've taken that script line out before...and it didnt work..but i probably had something else wrong.. truly amazing.. thank you so much twey.. its always the little things explain more about the credit

U mean this?
/***********************************************
* DD Tab Menu II script- &#169; Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code

and it should go in the HEAD of my html?

Twey
06-18-2006, 05:07 PM
<script language="javascript" type="text/javascript" src=_"nav.js"></script>That space shouldn't be there either.
are you saying its not possible to move some of this to a java script file?No, I'm saying it's not legal unless you leave the credit on the main page.

DreamGirlB
06-18-2006, 08:06 PM
Okay understood, now that I'm getting a little further.. I'm realizing that having even part of the navigation code (all the div statements), means that I have to repeat all those div statements on every single page. Is that normal?

Twey
06-18-2006, 08:22 PM
explain more about the credit

U mean this?
/***********************************************
* DD Tab Menu II script- &#169; Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code

and it should go in the HEAD of my html?Yes, and no, it should go between the <script></script> tags on your HTML page, along with the bottom line of "decoration."
I'm realizing that having even part of the navigation code (all the div statements), means that I have to repeat all those div statements on every single page. Is that normal?Yes, I think so, though I may have misunderstood what you're trying to say.

DreamGirlB
06-18-2006, 08:30 PM
Okay, so my navigation bar, needs to be on every page.. but all the text for the navigation bar is on test2.html ... if I make the new pages and need the navigation bar on those pages.. I have to paste all the text for the navigation bar on each of those pages..

Twey
06-18-2006, 08:38 PM
Unless you use some form of server-side scripting, yes.

djr33
06-19-2006, 07:46 AM
Or frames, but serverside scripting would be a LOT better.