tough question 2

M

Mr Shore

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
 
V

VK

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.public.scripting.jscript 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.
 
M

Mr Shore

You should use JScript or VBScript, I guess. As "IE only solution" you
may check my advise at microsoft.public.scripting.jscript 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="OpenChild()"/>
<input type="button" id="try" onclick="f();"/>
</body>
the son window:
<html>
<body onbeforeunload="g();" onload="X();">

<script>

function X()
{

document.body.appendChild(window.opener.document.getElementById('try'));
}


function g()
{

window.opener.document.body.appendChild(document.getElementById('try'));
}


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

RoLo

document.body.appendChild(window.opener.document.getElementById('try'));
window.opener.document.body.appendChild(document.getElementById('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
 
L

Lee

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.


--
 
M

Mr Shore

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?
http://www.meebo.com/
the chat window can be poped up both in ff and IE
 
M

Mr Shore

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
 
J

Joost Diepenmaat

Mr Shore said:
have you ever used this online im?
http://www.meebo.com/
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.
 
B

beegee

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
 
M

Mr Shore

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
 
M

Mr Shore

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.

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
 
J

Joost Diepenmaat

Mr Shore said:
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.appendChild(otherElement);

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.
 
M

Mr Shore

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.appendChild(otherElement);

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.
i think i can have a try to find it work both in IE and ff about which
i'm curious
 

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

Forum statistics

Threads
474,143
Messages
2,570,822
Members
47,368
Latest member
michaelsmithh

Latest Threads

Top