miseleigh Posted June 9, 2008 Share Posted June 9, 2008 We're trying to pass a link from a child window to the parent window after we upload a file. For some reason, the javascripts below don't even seem to be running, although all the values are filled in correctly after the php is done. The only thing we can think of is that the child loses its window.opener after processing its own form. Essentially, the parent calls the child, then the child processes a form to upload a file, and the child is then supposed to fill in a link to that document. <SCRIPT type="text/javascript"> window.opener.document.<?php echo $ret_field;?>.value = "<?php echo $link;?>"; window.close(); </SCRIPT> The child page uploads eveything properly, but then does not close and does not fill in the value on the parent. Thanks for any help. Quote Link to comment Share on other sites More sharing options...
miseleigh Posted June 9, 2008 Author Share Posted June 9, 2008 Well, we've figured out it's a cross-domain problem... and that a work-around for that is plug an iframe into the child that's located on the parent's domain. But how do we use that work-around in order to fill a field on the parent page? Quote Link to comment Share on other sites More sharing options...
miseleigh Posted June 9, 2008 Author Share Posted June 9, 2008 We solved it by using an intermediary page on the parent domain that does the javascripts after getting values from the child page. Just a warning to anyone else trying this: whether it's http or https, or whether the www is present or not, makes a difference to javascript- they must be alike before and after for js to recognize it as the same domain. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.