Log in

View Full Version : call external js



neilkw
09-07-2006, 10:52 AM
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

sandman
09-07-2006, 06:35 PM
I dont think you can use HTML in js files.
Call it from your HTML or use JS to write it.

yaldex
10-04-2006, 04:28 PM
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>')).