externalize the part the goes in the head section - that's the functional part of the code. The code in the body is what uses the funtions of the part in the head and needs to stay in the page. I'm guessing a little bit here since I don't know exactly how you're setup but I think that's usually the case.
oh - and welcome to WebmasterWorld :)
Thanks - it worked! And thanks for the welcome. :)
This goes into the BODY into the appropriate placement and does not need to be echoed in the HEAD section. Then the file named filename.js contains the content.
document.write (" ");
command line for my external .JS file. Don't forget to comment out the quotes that are a part of the navigation, with a backslash (\), like
document.write ("<a href=\"filename.htm\"></a>");
|"...Don't forget to comment out the quotes that are a part of the navigation, with a backslash (\), like |
document.write ("<a href=\"filename.htm\"></a>"); ..."
|document.write ('<a href="filename.htm"></a>'); |
You still might need to escape quotes from time to time, depending on the context, but much less often, and the code will be easier to read and debug.
You also need to escape the / of the closing </a> tag, and of any other closing tags, by changing to this format: <\/a> instead.