0

I have a popup window from which I want to retrieve a value, I want to send the value back to the page that initiated the popup window. I want to avoid using php if that's possible? Can someone tell me if this is possible, if so can it be done with javascript? And how could I start with it?

4

1 回答 1

1

是的:

child = window.open(...)
child.callback = function(value) { ... do something with value ... }

在您的子窗口中,您现在可以调用callback,就好像它是在那里定义的一样:

callback(value);
于 2012-05-22T08:16:54.683 回答