+ Reply to Thread
Results 1 to 3 of 3

Thread: External Javascript reference failing

  1. #1
    ansultd is offline x10Hosting Member ansultd is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    16

    External Javascript reference failing

    I am trying to pull in an external javascript file, rather than put the script in my HTML page. I am referencing it as such:

    <script language="javascript" type="text/javascript" src=""http://www.aj-web-design.com/script/test.js"></script>

    I can hit the URL of the file, so the path is correct.

    Is there a setting that I need to turn on to make it work? JavaScript works if it is in the HTML code, but once it is moved into an external file, it no longer works.

    Thanks in advance!
    Last edited by ansultd; 05-07-2008 at 03:54 PM.

  2. #2
    crisp is offline x10Hosting Member crisp is an unknown quantity at this point
    Join Date
    Feb 2008
    Posts
    85

    Re: External Javascript reference failing

    Is the fact you didn't post the url of the script because it's not yours?> If so, maybe the owner's wise and prevented hot-linking it? If it is yours, place it in your web root (public_html folder) and just put the name of the script in the src param (no path, just the filename). If it still doesn't work, either you didn't close the tag propery ( </script> not short form /> ) or the scripts broken.

    If it is broken and you're using firefox download Firebug extension then you can see what's happening with it.

  3. #3
    ansultd is offline x10Hosting Member ansultd is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    16

    Re: External Javascript reference failing

    I am th owner of the targeted file. When I posted, half of my post didn't make it for some reason, so I had to edit the post.
    =========================================
    I found the issue....

    Unclosed tags prior to the script tags.....

    dumb mistake, and sorry to waste your time.
    Last edited by ansultd; 05-07-2008 at 04:03 PM.

+ Reply to Thread

Similar Threads

  1. javascript and external javascript files problem
    By delon in forum Programming Help
    Replies: 6
    Last Post: 04-27-2008, 12:41 AM
  2. javascript external files
    By delon in forum Free Hosting
    Replies: 1
    Last Post: 04-25-2008, 10:19 AM
  3. JavaScript help!
    By disturbedart in forum Programming Help
    Replies: 5
    Last Post: 01-17-2008, 06:08 AM
  4. A question about javascript files
    By rlodge in forum Programming Help
    Replies: 6
    Last Post: 12-19-2007, 11:26 AM
  5. XML and Javascript
    By cuteboytm in forum Graphics & Webdesign
    Replies: 1
    Last Post: 09-21-2007, 10:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers