javascript within a javascript

Discussion in 'Javascript' started by u0107@usa.net, Jan 10, 2007.

  1. Guest

    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, 2007
    #1
    1. Advertising

  2. Randy Webb Guest

    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/
     
    Randy Webb, Jan 10, 2007
    #2
    1. Advertising

  3. Guest

    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:
    > 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, 2007
    #3
  4. Erwin Moller Guest

    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('<scrip";
    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:
    >> 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/
     
    Erwin Moller, Jan 10, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. KatB
    Replies:
    0
    Views:
    468
  2. mark4asp
    Replies:
    2
    Views:
    2,276
    Harry Haller
    Nov 7, 2006
  3. Elmo Watson
    Replies:
    1
    Views:
    622
    Eliyahu Goldin
    May 8, 2007
  4. Ultrus
    Replies:
    3
    Views:
    417
    Stefan Behnel
    Jul 9, 2007
  5. Abby Lee
    Replies:
    5
    Views:
    483
    Abby Lee
    Aug 2, 2004
Loading...

Share This Page