74
rated 0 times
[
75]
[
1]
/ answers: 1 / hits: 24467
/ 10 Years ago, tue, november 11, 2014, 12:00:00
I would like to use a local variable of a parent in child window. I used parent.window.opener
but it returns undefined
.
This is my code:
<script type=text/javascript>
var selectedVal;
$(document).ready(function () {
//....
//...
if ($(this).val() == byActor){
$(#tags).focus();
$(#tags).autocomplete({
source: actorsauto.php,
minLength: 2,
focus: function( event, ui ){
event.preventDefault();
return false;
},
select: function (event, ui){
var selectedVal = ui.item.value;
alert(selectedVal);
}
});
});
$('#btnRight').on('click', function (e) {
popupCenter(movieByactor.php,_blank,400,400);
});
</script>
</body>
</html>
and this is a child:
<body>
<script type=text/javascript>
var selectedVal = parent.window.opener.selectedVal;
alert(selectedVal);
</script>
</body>
More From » php