js 新开窗口与传递信息案例

设计一个网页,使得打开它时弹出一个全屏的窗口,该窗口中有一个文本框和一个按钮。用户在文本框中输入信息后点击按钮就可以把窗口关闭,而输入的信息却在主网页中显示。


Index.php页


<html>


<head>


<title>主页</title>


</head>


<body οnlοad=” window.open('fullwin.php','roc3000','fullscreen')”>


</body>


<table>


<tr>


<td>


<input type=”text “value=”<?php echo $userinput?>”  name=”show”  id=”show”>


</td>


</tr>


</table>


</html>


fullwin.php页


<html>


<head>


<title>弹出全屏窗口的网页</title>


<script>


<!--


function winclosel(){


window.close();


window.open("index.php","","fullscreen=1");


}


//-->


</script>


</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" scroll="no" >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td>


<input type=”text “value=”<?php echo $userinput?>”  name=”userinput”  id=”userinput” οnclick=”winclose()”>


</td></tr>


<tr><td>


<input type=”summit “value=”<?php echo $userinput?>”  name=”jump”  id=”jump”


Onclik=>
</td></tr>
</table>


</body>


</html>


附:
 toolbar=no 是否显示工具栏,yes为显示;
 menubar,scrollbars 表示菜单栏和滚动栏。
 resizable=no 是否允许改变窗口大小,yes为允许;
 location=no 是否显示地址栏,yes为允许;
 status=no 是否显示状态栏内的信息(通常是文件已经打开),yes为允许;
 width=400 窗口宽度;
 height=300 窗口高度;
 top=0 窗口距离屏幕上方的象素值;
 left=0 窗口距离屏幕左侧的象素值;


 


<form   name="form1"   method="post"   action='main.php'   οnsubmit='window.open("","winName","fullscreen=1")'   target=winName>  


<form   name="form1"   method="post"   action=''   οnsubmit='window.open("main.php","","fullscreen=1")'>  


window.open("filename","","fullscreen=1");


window.open(Url,'cscedcLogin',"dependent,alwaysLowered=0,alwaysRaised=0,channelmode=0,dependent=0,directories=0,fullscreen=1,hotkeys=1,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,z-lock=0,screenX=0,screeny=0,left=0,top=0,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no");




关闭前一个窗口??   
   window.opener=null;   
  window.close();

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值