473,320 Members | 1,876 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.

javascript within a javascript

Hello,

I have a multi-frame page. The frames are named Frame_1, Frame_2 and
Frame_3.

Frame_1 has a drop down box. When a value is selected in this drop
down box, Frame_2 is updated using an asp file (as I have to read from
a back-end access database).

In turn in the asp file, I have a Body onload tag to execute a
javascript function within Frame_2. this function updates the contents
of Frame_3.

Till now this is working fine.

Here is the problem. Frame_3 has a form with a radio button. When a
radio button is selected, I want that a function be executed in
Frame_3.

However since content of Frame_3 is updated using
"window.parent.Frame_3.document.writeln(", I cannot include "<Script
language="javascript" etc within the text of the window.parent. etc
because Script within a script is not allowed.

Any suggestions on how to overcome this?

Thanks in advance.

U

Jan 10 '07 #1
3 2069
u0***@usa.net said the following on 1/10/2007 1:25 AM:
Hello,

I have a multi-frame page. The frames are named Frame_1, Frame_2 and
Frame_3.

Frame_1 has a drop down box. When a value is selected in this drop
down box, Frame_2 is updated using an asp file (as I have to read from
a back-end access database).

In turn in the asp file, I have a Body onload tag to execute a
javascript function within Frame_2. this function updates the contents
of Frame_3.

Till now this is working fine.

Here is the problem. Frame_3 has a form with a radio button. When a
radio button is selected, I want that a function be executed in
Frame_3.

However since content of Frame_3 is updated using
"window.parent.Frame_3.document.writeln(", I cannot include "<Script
language="javascript" etc within the text of the window.parent. etc
because Script within a script is not allowed.
Any suggestions on how to overcome this?
document.write('<\/script>') instead of document.write('</script>')

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jan 10 '07 #2
This is the exact error that I get:

Active Server Pages, ASP 0138 (0x80004005)
A script block cannot be placed inside another script block

....2.asp, line 255

And Line 255 is

response.write "
window.parent.Frame_No_33.document.writeln(" & quote & "<script
language=....

I tried defining two variables lt = chr(60) and gt = chr(62) which are
respectively the less than (<) and the greater than (>) signs and
replaced the "<" in "<script...".

Still that did not work.

I tried your suggested solution but that did not work.

Appreciate other solutions.

thanks in advance

Randy Webb wrote:
u0***@usa.net said the following on 1/10/2007 1:25 AM:
Hello,

I have a multi-frame page. The frames are named Frame_1, Frame_2 and
Frame_3.

Frame_1 has a drop down box. When a value is selected in this drop
down box, Frame_2 is updated using an asp file (as I have to read from
a back-end access database).

In turn in the asp file, I have a Body onload tag to execute a
javascript function within Frame_2. this function updates the contents
of Frame_3.

Till now this is working fine.

Here is the problem. Frame_3 has a form with a radio button. When a
radio button is selected, I want that a function be executed in
Frame_3.

However since content of Frame_3 is updated using
"window.parent.Frame_3.document.writeln(", I cannot include "<Script
language="javascript" etc within the text of the window.parent. etc
because Script within a script is not allowed.
Any suggestions on how to overcome this?

document.write('<\/script>') instead of document.write('</script>')

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Jan 10 '07 #3
u0***@usa.net wrote:
This is the exact error that I get:

Active Server Pages, ASP 0138 (0x80004005)
A script block cannot be placed inside another script block

...2.asp, line 255

And Line 255 is

response.write "
window.parent.Frame_No_33.document.writeln(" & quote & "<script
language=....
Hi,

Not sure, but I solved a similar problem once like this:

Dim str
str = "window.parent.Frame_No_33.document.writeln('<scri p";
str=str& "t language=...>"

response.write str

If you break on the script-word I might work.

Regards,
Erwin Moller
>
I tried defining two variables lt = chr(60) and gt = chr(62) which are
respectively the less than (<) and the greater than (>) signs and
replaced the "<" in "<script...".

Still that did not work.

I tried your suggested solution but that did not work.

Appreciate other solutions.

thanks in advance

Randy Webb wrote:
>u0***@usa.net said the following on 1/10/2007 1:25 AM:
Hello,

I have a multi-frame page. The frames are named Frame_1, Frame_2 and
Frame_3.

Frame_1 has a drop down box. When a value is selected in this drop
down box, Frame_2 is updated using an asp file (as I have to read from
a back-end access database).

In turn in the asp file, I have a Body onload tag to execute a
javascript function within Frame_2. this function updates the contents
of Frame_3.

Till now this is working fine.

Here is the problem. Frame_3 has a form with a radio button. When a
radio button is selected, I want that a function be executed in
Frame_3.

However since content of Frame_3 is updated using
"window.parent.Frame_3.document.writeln(", I cannot include "<Script
language="javascript" etc within the text of the window.parent. etc
because Script within a script is not allowed.
Any suggestions on how to overcome this?

document.write('<\/script>') instead of document.write('</script>')

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices -
http://www.JavascriptToolbox.com/bestpractices/
Jan 10 '07 #4

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

Similar topics

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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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.