...

View Full Version : How to call a js file



65tom
06-03-2003, 02:55 AM
I need to be able to call a js file from within a document.write staement. Here is an example of the document.write statement, I am currently using.

if(docloc==urls[16]){
document.write('<a href="mailto:postmaster@traderdepot.com"><img src ="http://www.traderdepot.com/Bannerforbusiness.jpg"></a>')

If the document location is equal to a given url a certain banner will be displayed.

Instead of using the <a href="mailto:postmaster@traderdepot.com"><img src ="http://www.traderdepot.com/Bannerforbusiness.jpg"></a> I am wanting to use src="jsfile.js" for example.

When I place the src="jsfile.js" in the document.write statement the code stops working.

What should the code look like, to pull in the external js file.

joh6nn
06-03-2003, 05:47 AM
http://www.codingforums.com/showthread.php?s=&threadid=20960

scriptkeeper
06-03-2003, 06:39 AM
<javascript src="javascript.js">
</javascript>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum