2014年1月31日 星期五

html-return



function function_3ZM0MLGJX()     {
if (window.showModalDialog) {
var returnTarget=window.showModalDialog("solistmc.php",this,
"dialogWidth:600px;dialogHeight:400px;resizable:0;scroll:0;");
} else  {
var returnTarget=window.open ("solistmc.php",this,"height=400px,width=600px,toolbar=no,directories=no, status=no,memubar=no,modal=yes,location=no,resizable=no,menubar=no, scrollbars=no,copyhistory=no");
}

http://stackoverflow.com/questions/16421922/getting-value-from-popup-window-using-only-js-html


parent.html
<input type="text" id="output"/>
<button id="show">Open</button>

<script>
    document.getElementById('show').addEventListener('click', function(){
        window['output'] = document.getElementById('output');
        window.open('map.html')
    });
</script>  
maps.html (I changed the extension!)
<input type="text" id="user_text"/>
<input id="send" type='button' value'send'/>

<script>
    document.getElementById('send').addEventListener('click', function(){
    window.opener['output'].value = document.getElementById('user_text').value;
})
</script>

沒有留言:

張貼留言