Forum Moderators: open
________________________________
<script language="JavaScript" type="text/javascript">
<!--
origURL = parent.document.URL
contentURL = origURL.substring(origURL.indexof('?')+1, origURL.length)
document.write('<frameset rows="117,*" frameborder="0" border="0" framespacing="0">
<frame name="top" src="top_frame_content.html" scrolling="no"
marginheight="0" marginwidth="0" noresize>
<frameset cols="141,*" frameborder="0" border="0" framespacing="0">
<frame name="nav" src="left_frame_content.html" scrolling="no"
marginheight="0" marginwidth="0" noresize >
<frame name="content" src="'+contentURL+'" scrolling="auto"
marginheight="0" marginwidth="0" noresize>
<\/frameset>
<\/frameset>')
//-->
</script>
You start the document.write with a single quote (not a good idea BTW - use double quotes here and single quotes for the inside stuff).
Then, you use line breaks for each of the next lines. You can't do that in javascript.
Create a string variable:
var pg = "";
then, concatenate all your code with +
pg = "<frameset rows='117,*' frameborder='0' border='0' framespacing='0'>";
pg += "<frame name='top' src='top_frame_content.html' scrolling='no'
marginheight='0' marginwidth='0' noresize> ";
etc.
then, it's as simple as:
document.write(pg);
and you won't get those unterminated string errors.
origURL = location.href +"";
contentURL = origURL.substring(origURL.indexOf('?')+1, origURL.length)
and get rid of the newlines in your document.write as txbak suggests, it'll work. Just tested it.
If you are getting nowhere, use mozilla or netscape 4 browsers to test. Open your document in the browser and type-
javascript:
in the location bar. This will pop-up a console which may help track down where the error is.
<script type="text/javascript">
I've seen using both cause problems with scripts before... although, since you're getting a specific error, I doubt that this will help, other than to make your code standards compliant!