Results 1 to 4 of 4

Thread: downloading .js files and correctly linking to them

  1. #1
    Join Date
    Dec 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default downloading .js files and correctly linking to them

    1) Script Title:

    AnyLink JS Drop Down Menu v2.3

    2) Script URL (on DD):

    http://www.dynamicdrive.com/dynamici...pmenuindex.htm

    3) Describe problem:

    Hello. this is a VERY amateur problem. normally when I use the scripts there is just a script to copy and paste and to customize. However i have found that all of the drop down menu scripts have external files to download and link to. So, I thought that's fine. However I have tried so many different scripts with external files instead of just putting the script directly into my code and can never get it to work correctly. I would honestly much rather just put the code into my code without external files but cannot find a good code that does that.

    I do realize i could easily do it with CSS but don't want to because I need the javascript to override other elements on my page with out using absolute positioning (but that's a whole other issue...)

    Anyways, this AnyLink JS Drop Down Menu v2.3 script for example, has 3 external files:
    anylinkmenu.js
    menucontents.js
    anylinkmenu.css

    And I think you link to them in the head:
    Code:
    <link rel="stylesheet" type="text/css" href="anylinkmenu.css" />
    
    <script type="text/javascript" src="menucontents.js"></script>
    
    <script type="text/javascript" src="anylinkmenu.js">
    however i have realized that only in scripts with external files, i cannot get to work on my page. I have of course tried uuploading the files to my go daddy site under html. Also I have tried changing the src="" to the whole link like www.page.com/file.js instead of just file.js

    I know it has to be that i am not linking to external files correctly but i dont know... all the scripts have external files, instead of just copy and paste into your head and body and then customize..
    Last edited by jscheuer1; 02-03-2012 at 06:41 PM. Reason: Format

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I have of course tried uuploading the files to my go daddy site under html
    But they're not html. They need to be uploaded as the files that they are, .js or .css respectively.

    With something like AnyLink JS Drop Down Menu v2.3 it might be best to get a local version working first. Using a text only editor like NotePad, make up an html file using the step by step instructions. Use this blank page to start:

    HTML Code:
    <!DOCTYPE html>
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <!-- Put the head stuff here -->
    </head>
    <body>
    <!-- Put the body stuff here -->
    </body>
    </html>
    Put the head stuff in the head and the body stuff in the body. Don't try to modify anything yet. Put it in a folder by itself. Call it test.html. Then download the .js and .css files and put them in the same folder. Then view the html file in the browser, not in some editor.

    If that works out, then you can modify the menucontents.js file, again - use a text only editor.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Dec 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    When I say I uploaded them under html, i did not mean i change the file extension to .html I ment that is the main folder on godaddy,where all the files lay. i kep the file extensions as .css or .js.

  4. #4
    Join Date
    Dec 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I will do a test file soon and post the link, thanks for the help.

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
  •