tough question 2

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mr Shore

    tough question 2

    how to do the follows in IE:
    there's page A with element a
    pop a new page B from script in A
    and append element a into B
    after closing page B
    put element a back into A

    'IE' solution only

  • VK

    #2
    Re: tough question 2

    On Apr 14, 12:46 am, Mr Shore <shore.cl...@gm ail.comwrote:
    how to do the follows in IE:
    there's page A with element a
    pop a new page B from script in A
    and append element a into B
    after closing page B
    put element a back into A
    >
    'IE' solution only
    You should use JScript or VBScript, I guess. As "IE only solution" you
    may check my advise at microsoft.publi c.scripting.jsc ript but I'm
    pretty sure that they will come to the same conclusion.

    Post or link your best attempt you have made so far and we may try to
    come together to some cross-browser solution.

    Comment

    • Mr Shore

      #3
      Re: tough question 2

      On Apr 14, 4:58 am, VK <schools_r...@y ahoo.comwrote:
      On Apr 14, 12:46 am, Mr Shore <shore.cl...@gm ail.comwrote:
      >
      how to do the follows in IE:
      there's page A with element a
      pop a new page B from script in A
      and append element a into B
      after closing page B
      put element a back into A
      >
      'IE' solution only
      >
      You should use JScript or VBScript, I guess. As "IE only solution" you
      may check my advise at microsoft.publi c.scripting.jsc ript but I'm
      pretty sure that they will come to the same conclusion.
      >
      Post or link your best attempt you have made so far and we may try to
      come together to some cross-browser solution.
      ok,to declare it more clearly
      the parent window:
      <body>
      <script>
      function OpenChild()
      {
      var childWin = window.open("t. html");
      }

      </script>
      <input type="button" onclick="OpenCh ild()"/>
      <input type="button" id="try" onclick="f();"/>
      </body>
      the son window:
      <html>
      <body onbeforeunload= "g();" onload="X();">

      <script>

      function X()
      {

      document.body.a ppendChild(wind ow.opener.docum ent.getElementB yId('try'));
      }


      function g()
      {

      window.opener.d ocument.body.ap pendChild(docum ent.getElementB yId('try'));
      }


      </script>
      </body>
      </html>
      passed in ff,but failed in IE

      Comment

      • RoLo

        #4
        Re: tough question 2

        document.body.a ppendChild(wind ow.opener.docum ent.getElementB yId('try'));
        window.opener.d ocument.body.ap pendChild(docum ent.getElementB yId('try'));
        appending elements from different documents is not possible on IE (im
        99% sure), you have to create the elements
        on their corresponding document, probably would be better if you use
        innerHTML

        Comment

        • Lee

          #5
          Re: tough question 2

          Mr Shore said:

          You might also want to consider the fact that many people
          will ignore messages with useless subject lines like
          "tough question".
          Use the subject line to give a clue about what sort of
          question you're asking.


          --

          Comment

          • Mr Shore

            #6
            Re: tough question 2

            On Apr 14, 10:10 am, RoLo <roloswo...@gma il.comwrote:
            document.body.a ppendChild(wind ow.opener.docum ent.getElementB yId('try'));
            window.opener.d ocument.body.ap pendChild(docum ent.getElementB yId('try'));
            >
            appending elements from different documents is not possible on IE (im
            99% sure), you have to create the elements
            on their corresponding document, probably would be better if you use
            innerHTML
            have you ever used this online im?

            the chat window can be poped up both in ff and IE

            Comment

            • Mr Shore

              #7
              Re: tough question 2

              On Apr 14, 11:37 am, Lee <REM0VElbspamt. ..@cox.netwrote :
              Mr Shore said:
              >
              You might also want to consider the fact that many people
              will ignore messages with useless subject lines like
              "tough question".
              Use the subject line to give a clue about what sort of
              question you're asking.
              >
              --
              ok

              Comment

              • Joost Diepenmaat

                #8
                Re: tough question 2

                Mr Shore <shore.cloud@gm ail.comwrites:
                On Apr 14, 10:10 am, RoLo <roloswo...@gma il.comwrote:
                document.body.a ppendChild(wind ow.opener.docum ent.getElementB yId('try'));
                window.opener.d ocument.body.ap pendChild(docum ent.getElementB yId('try'));
                >>
                >appending elements from different documents is not possible on IE (im
                >99% sure), you have to create the elements
                >on their corresponding document, probably would be better if you use
                >innerHTML
                >
                have you ever used this online im?

                the chat window can be poped up both in ff and IE
                What's that got to do with anything? Read RoLo's text again. By the way,
                the quoted code also won't work on Opera; again - you shouldn't move
                elements from one document to another.

                --
                Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/

                Comment

                • beegee

                  #9
                  Re: tough question 2

                  On Apr 13, 4:46 pm, Mr Shore <shore.cl...@gm ail.comwrote:
                  how to do the follows in IE:
                  there's page A with element a
                  pop a new page B from script in A
                  and append element a into B
                  after closing page B
                  put element a back into A
                  >
                  'IE' solution only
                  As stated, appending elements from one page to another is a bad idea.
                  Just return a value from page B and construct a new element in page
                  A. Not a big deal.

                  Bob

                  Comment

                  • Mr Shore

                    #10
                    Re: tough question 2

                    On Apr 14, 10:11 pm, beegee <bgul...@gmail. comwrote:
                    On Apr 13, 4:46 pm, Mr Shore <shore.cl...@gm ail.comwrote:
                    >
                    how to do the follows in IE:
                    there's page A with element a
                    pop a new page B from script in A
                    and append element a into B
                    after closing page B
                    put element a back into A
                    >
                    'IE' solution only
                    >
                    As stated, appending elements from one page to another is a bad idea.
                    Just return a value from page B and construct a new element in page
                    A. Not a big deal.
                    >
                    Bob
                    could you provide a instance?
                    elements with listeners are quite troublesome to handle i think

                    Comment

                    • Mr Shore

                      #11
                      Re: tough question 2

                      On Apr 14, 7:32 pm, Joost Diepenmaat <jo...@zeekat.n lwrote:
                      Mr Shore <shore.cl...@gm ail.comwrites:
                      On Apr 14, 10:10 am, RoLo <roloswo...@gma il.comwrote:
                      document.body.a ppendChild(wind ow.opener.docum ent.getElementB yId('try'));
                      window.opener.d ocument.body.ap pendChild(docum ent.getElementB yId('try'));
                      >
                      appending elements from different documents is not possible on IE (im
                      99% sure), you have to create the elements
                      on their corresponding document, probably would be better if you use
                      innerHTML
                      >
                      have you ever used this online im?

                      the chat window can be poped up both in ff and IE
                      >
                      What's that got to do with anything? Read RoLo's text again. By the way,
                      the quoted code also won't work on Opera; again - you shouldn't move
                      elements from one document to another.
                      >
                      --
                      Joost Diepenmaat | blog:http://joost.zeekat.nl/| work:http://zeekat.nl/
                      have you tried its im chat functionality?
                      it can pop out from parent window and return to the parent windows
                      when the popping out window is closed,which is the same with my case
                      in principle

                      Comment

                      • Joost Diepenmaat

                        #12
                        Re: tough question 2

                        Mr Shore <shore.cloud@gm ail.comwrites:
                        have you tried its im chat functionality?
                        No.
                        it can pop out from parent window and return to the parent windows
                        when the popping out window is closed,which is the same with my case
                        in principle
                        But that's unrelated to the problem. You seem to be misreading the
                        (correct) statement "you can't reliably move nodes / elements from one
                        document to the other" as "you can't communicate between documents".

                        IOW, the exactly problem is that:

                        someElement.app endChild(otherE lement);

                        Is *NOT* guaranteed to work when otherElement is not created by and/or
                        removed from the same root document that someElement was created by
                        and/or removed from.


                        --
                        Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/

                        Comment

                        • Mr Shore

                          #13
                          Re: tough question 2

                          On Apr 15, 3:25 am, Joost Diepenmaat <jo...@zeekat.n lwrote:
                          Mr Shore <shore.cl...@gm ail.comwrites:
                          have you tried its im chat functionality?
                          >
                          No.
                          >
                          it can pop out from parent window and return to the parent windows
                          when the popping out window is closed,which is the same with my case
                          in principle
                          >
                          But that's unrelated to the problem. You seem to be misreading the
                          (correct) statement "you can't reliably move nodes / elements from one
                          document to the other" as "you can't communicate between documents".
                          >
                          IOW, the exactly problem is that:
                          >
                          someElement.app endChild(otherE lement);
                          >
                          Is *NOT* guaranteed to work when otherElement is not created by and/or
                          removed from the same root document that someElement was created by
                          and/or removed from.
                          >
                          --
                          Joost Diepenmaat | blog:http://joost.zeekat.nl/| work:http://zeekat.nl/
                          i think i can have a try to find it work both in IE and ff about which
                          i'm curious

                          Comment

                          Working...