Results 1 to 4 of 4

Thread: Help the script is not working-all files linked

  1. #1
    Join Date
    Jan 2011
    Location
    Southeastern CT
    Posts
    612
    Thanks
    46
    Thanked 32 Times in 32 Posts

    Default Help the script is not working-all files linked

    Hi Folks, I am back trying to figure out why this wont' work:

    The original script is on this page that works fine:
    http://web-user.net/rss/test/drop.html

    Now I want to put the javascript in to a file by it self:
    http://web-user.net/rss/test/drop.js

    And tried the link to the external file on this page:
    http://web-user.net/rss/test/drop2.html

    Now I can tell that it is not working due to the text in the dropdown when the page loads-it should have JavascriptKit in it.This is a place holder is there instead telling me the javascript code is not being rendered (is that the right way to say it?)

    What is wrong with the drop.js file? I thought the start and end tags(<script></script>) have to be removed.

    I am confused with this and any help would be greatly appreicated.

    Thanks,

    Bud


    ps-Would people prefer to have the code put here instead of the links to each file?I want to do this the prefered way if I can
    Last edited by ajfmrf; 02-01-2011 at 03:12 AM. Reason: spelling error-again

  2. #2
    Join Date
    Oct 2009
    Posts
    845
    Thanks
    14
    Thanked 189 Times in 188 Posts

    Default

    It seems to work if you put the javascript at the bottom of the page instead of in the head section. I guess the form has to load before the script for it to work.
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
    <title>dropdown test</title>
    </head>
    <body>
    <form name="dynamiccombo">
    <select name="stage2" size="1">
    <option value="#">This is a Place Holder</option>
    <option value="#">This is a Place Holder</option>
    <option selected="selected" value="#">This is a Place Holder</option>
    </select>
    <input name="test" value="Go!" onClick="gothere()" type="button">
    </form>
    <!--SET up your links, and pass in the name of the group (ie: combo1) you wish to display for the link in question-->
    <a href="javascript:populate(combo1)">Webmaster sites</a> | <a href="javascript:populate(combo2)">News sites</a> | <a href="javascript:populate(combo3)">Entertainment</a>
    <p align="center">This free script provided by<br>
    <a href="http://javascriptkit.com/">JavaScript
    Kit</a></p>
    <script type="text/javascript" src="drop.js"></script>
    </body>
    </html>

  3. #3
    Join Date
    Jan 2011
    Location
    Southeastern CT
    Posts
    612
    Thanks
    46
    Thanked 32 Times in 32 Posts

    Default Thanks azoomer

    I guess that is something I should have tried but I never saw a script that works like that so I never thought it could work.

    Thanks for your help azoomer

    Bud

    ps-how do the posts get mark as resolved?
    Last edited by ajfmrf; 01-31-2011 at 09:41 PM. Reason: a thought

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

    Default

    To mark a thread as resolved, edit your first post and use the dropdown menu to select "resolved".
    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
  •