javascript within a javascript

U

u0107

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
 
R

Randy Webb

(e-mail address removed) 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>')
 
U

u0107

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
 
E

Erwin Moller

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('<scrip";
str=str& "t language=...>"

response.write str

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

Regards,
Erwin Moller
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top