I have the following HTML page (see bottom of message) that consists of a
frame with two windows. The top window is always the menu, and the bottom
window is by default a document named "TheDesc.htm". However, if another
page is called, I want to display this new page into the bottom frame in
place of "TheDesc.htm".
My problem is with the third document.write command in the SCRIPT section.
document.write('<FRAME SRC="+%20(%20location.search%20?
location.search.substring(1):" TheDesc.htm") + NAME="MAIN">');
I get an error message when calling another page, like:
http://www.mysite.com/myframe.html?h...om/newpage.htm
Any idea what is wrong with this line?
BTW, I got this script from a web site, so I'm not sure I fully understand
this like. What %20 means.
Richard
<HTML>
<HEAD>
<SCRIPT language="JavaScript">
document.write('<FRAMESET FRAMEBORDER="0" BORDER="0" FRAMESPACING="0"
ROWS="121,85%">');
document.write('<FRAME SRC="TheMenu.htm" NAME="MENU" MARGINWIDTH="0"
MARGINHEIGHT="0">');
document.write('<FRAME SRC="+%20(%20location.search%20?
location.search.substring(1):" TheDesc.htm") + NAME="MAIN">');
document.write('<\/FRAMESET>');
</SCRIPT>
</HEAD>
<FRAMESET FRAMEBORDER="0" BORDER="0" FRAMESPACING="0" ROWS="125,84%">
<FRAME SRC="TheMenu.htm" NAME="MENU" MARGINWIDTH="0" MARGINHEIGHT="0">
<FRAME SRC="TheDesc.htm" NAME="MAIN" MARGINWIDTH="8">
<NOFRAMES>
<BODY>
Viewing this page requires a browser capable of displaying frames.
</BODY>
</NOFRAMES>
</FRAMESET>
</HTML>