Results 1 to 10 of 10

Thread: Problems separating out js and css from code on Dynamic Drive

  1. #1
    Join Date
    Jun 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Problems separating out js and css from code on Dynamic Drive

    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.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jun 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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?

  4. #4
    Join Date
    Jun 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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?

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
    	<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.
    Last edited by Twey; 06-18-2006 at 05:42 PM.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Jun 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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?

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    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.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #8
    Join Date
    Jun 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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..

  9. #9
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Unless you use some form of server-side scripting, yes.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  10. #10
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Or frames, but serverside scripting would be a LOT better.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •