473,320 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Loading a page in a frame

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>
Jul 23 '05 #1
1 1418
On Mon, 19 Apr 2004 11:35:24 -0400, RichardM <Ri******@nospam.ca> wrote:

[snip]
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">');
That statement appears to be complete rubbish. What you probably want is

document.write('<frame src="' + location.search.substring( 1 ) +
'" name="MAIN">');

[snip]
BTW, I got this script from a web site, so I'm not sure I fully
understand this like. What %20 means.
The number of usable characters in a URI is limited. To escape restricted
characters, you take the character code, convert it to hexadecimal, and
prefix a percentage symbol. %20 represents a space.
<SCRIPT language="JavaScript">


SCRIPT elements require a type attribute, which negates the need for the
language attribute. The above should read

<script type="text/javascript">

[snip]

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk" to reply)
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Alex Hunter | last post by:
is there a way to make one frame on a page load completely before the other frame starts loading?
3
by: markeboy | last post by:
I am wanting to control when a page is loaded using a separate class to manage when and how it should be loade My current implementation needs to set a property of the page programatically...
3
by: HK guy | last post by:
How to write a program that can check the web page loading time? Before I have written a browser that use IE as the core, but it does not support frame. Since the documentcomplete event will...
1
by: John Smith | last post by:
Hey folks, Got a weird one for you that I think may just be a bug with Internet Explorer. I have a page that hosts an IFrame. When I call Javascript in my page to change the source of the...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.