开发者

Getting data from a child window [duplicate]

This question already has answers here: Closed 10 years ago.

Possible Duplicate:

getting data from child window

I am working on a project and have encountered a problem. Please view the following code.

<iframe name="stus" id="stus" style="display:none;"></iframe><div id="posting"></div>

<form name="water" id="water" method="post"  autocomplete="off" action="components/com_pocketsea/assets/new/water.php" target="stus">
<input text="text" id="newwatermark" name="newwatermark"><input type="submit"></form>

The code for water.php is

开发者_如何学编程
<?php $tt = $_POST['newwatermark'];  ?>
    <script type="text/javascript" src="../../js2/jquery.min.js" ></script>  
    <script>        $(document).ready(function(){ $("#posting", window.parent.document).html("<?php echo $tt; ?>").fadeIn('slow'); }); </script>

The script is not working. Water.php is not being loaded in parent. This works well in custom but not in joomla. plz help.


you can use opener method to access parent window element...

 $('#myform').submit(function(){     
       opener.document.getElementById('parentWindowElem').innerHTML = document.getElementById ('childWindowElem').value;    
}); 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜