Want to use javascript to write // to an html file
I am trying to use javascript's document.write method to write a link to an html file, but my link doesn't work. I think it is because it includes http://. The two forward slashes are interpreted by javascript as a comment and the rest of the line is ignored. I tried to use the escape character in front of each of the forward slashes, but that didn't work. Any suggestions?
Re: Want to use javascript to write // to an html file
I am not sure that I understand what you are trying to achieve. The JavaScript would be called BY or coded as part of an html file.
A .JS file would contain a series of document.write commands and would be called by the html file that was using it.
The page linked above is an example of a page that uses a JavaScript file with document.write statements for common text at the end of each section. Save the page and view all the source to see how it works.