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;
});
精彩评论