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.
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.