Remon Jones
09-21-2005, 05:51 AM
Hello,
I have created an html image map that I would like to have appear on multiple Web pages; therefore, I would like to place the html instructions inside document.write commands in a js file. I have had no trouble in the past when it comes to getting external js files to perform using document.write commands; I often use js files to supply a consistent navigation area, for instance; however, I can't seem to make my image map work when I call it up from an external file. (The image map works fine when its coding is on the html page itself.)
Below is an abbreviated version of the js file I am using so that hopefully someone can tell me what I'm doing wrong. The file name is test.js and the script is "called" in the body section of my html page with the line
<SCRIPT SRC="test.js" TYPE="text/javascript">
abbreviated version of external file test.js.........
document.write ('<MAP NAME="owlalleyMap4">');
document.write ('<AREA SHAPE="polygon" COORDS="65,138,94,126,110,161,115,187,82,185,80,204,67,202" HREF="mailto:quass@quass.com" TITLE="E-mail owlmaster Brian">');
document.write ('<IMG SRC="http://www.quass.com/owlspecies/owlalley.jpg" WIDTH="681" HEIGHT="369" ALIGN="BOTTOM" BORDER="0" USEMAP="#owlalleyMap4">');
Thanks for any and all help,
Brian
I have created an html image map that I would like to have appear on multiple Web pages; therefore, I would like to place the html instructions inside document.write commands in a js file. I have had no trouble in the past when it comes to getting external js files to perform using document.write commands; I often use js files to supply a consistent navigation area, for instance; however, I can't seem to make my image map work when I call it up from an external file. (The image map works fine when its coding is on the html page itself.)
Below is an abbreviated version of the js file I am using so that hopefully someone can tell me what I'm doing wrong. The file name is test.js and the script is "called" in the body section of my html page with the line
<SCRIPT SRC="test.js" TYPE="text/javascript">
abbreviated version of external file test.js.........
document.write ('<MAP NAME="owlalleyMap4">');
document.write ('<AREA SHAPE="polygon" COORDS="65,138,94,126,110,161,115,187,82,185,80,204,67,202" HREF="mailto:quass@quass.com" TITLE="E-mail owlmaster Brian">');
document.write ('<IMG SRC="http://www.quass.com/owlspecies/owlalley.jpg" WIDTH="681" HEIGHT="369" ALIGN="BOTTOM" BORDER="0" USEMAP="#owlalleyMap4">');
Thanks for any and all help,
Brian