Results 1 to 3 of 3

Thread: call external js

  1. #1
    Join Date
    Nov 2005
    Posts
    132
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default call external js

    hi

    I am trying to call in js files externally to make my site a little more compact and faster. The js actually exists on another website

    Can anyone let me know what i'm doing wrong.
    I am calling in the script file called roman.js via this link -
    <SCRIPT SRC="romanjs.js">
    </SCRIPT>

    the js file contains this code.
    <script language="JavaScript" type="text/javascript" src="http://www.websitenamehere.com/cartinfo.asp?storeid=*****&amp;type=2"></script>

    cheers
    Neil

  2. #2
    Join Date
    Sep 2006
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I dont think you can use HTML in js files.
    Call it from your HTML or use JS to write it.

  3. #3
    Join Date
    Oct 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I agree. Either call from html (<script language="JavaScript" type="text/javascript" src="http://www.websitenamehere.com/cartinfo.asp?storeid=*****&amp;type=2"></script>) or use document.write in JavaScript file (document.write('<script language="JavaScript" type="text/javascript" src="http://www.websitenamehere.com/cartinfo.asp?storeid=*****&amp;type=2"></script>')).

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
  •