弹出新窗口输入返回到原页面

    技术2022-05-11  58

    a.html

    <script> function openOther(v){  var w = showModalDialog("b.html");  v.val.value=w;  }</script>

    <form> <input name="val"> <input type="button" οnclick="openOther(this.form);" value="click"></form>

    <script> function sopen(vv){  var w = showModalDialog("b.html");  w = w + "";  if( w != "undefined" ){   vv.v.value = w;  }   }</script>

    <form> <input name="v"> <input type="button" οnclick="sopen(this.form);" value="open"></form> 

     

    b.html

    <script> function returnText(v){  window.returnValue = v.val.value;  window.close();  }</script>

    <form> <input name="val"> <input type="button" οnclick="returnText(this.form);" value="return"></form>

     


    最新回复(0)