login.htm <html> <head> <title>用户登录</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css"> <!-- body { background-color: #EAEAEA; font-family: Arial, Helvetica, sans-serif; font-size: 12px; line-height: 24px; color: #336699; } input.boxline { width: 100px; font-family: "Times New Roman", "Times", "serif"; font-size: 9pt; border: 1px solid #669999; height: 18px;
}
input.whiteline { font-size: 12px; border: 1px #999999 solid } --> </style></head> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="14" bgcolor="#CCCCCC"> <tr valign="top"> <td width="10%" nowrap align="right"><b>用户名:</b></td> <td width="90%"><input name="textfield1" type="text" size="25" class="whiteline"></td> </tr> <tr valign="top"> <td nowrap align="right"><b>密 码:</b></td> <td><input name="textfield12" type="password" size="25" class="whiteline"></td> </tr> <tr valign="top"> <td> </td> <td><input type="submit" name="Submit" value="登 录" class="boxline"></td> </tr> </table> </body> </html>
自动关掉原窗口:
<html> <head> <title>无标题文档</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } --> </style> </head>
<body onload="window.open('fullscreen.htm','','fullscreen=1,scroll=no'); window.opener=null;window.close()"> <input type=button value=关闭 onclick="window.opener=null;window.close()"> <!-- IE5.5+ 不会有弹出提示 -->
<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0></OBJECT> <input type=button value=关闭窗口 onclick=document.all.WebBrowser.ExecWB(45,1)> </body> </html>
关键是在onload事件中加入: window.opener=null;window.close()
预读图片: <SCRIPT LANGUAGE="javascript">
<!-- This script and many more are available free online at --> <!-- The javascript Source!! <a href=http://javascript.internet.com target=_blank>http://javascript.internet.com -->
<!-- Begin
image1 = new Image(); image1.src = "image1.gif";
image2 = new Image(); image2.src = "image2.gif";
// End --> </script>
关于两个网页刷新交互的问题 JS处理方法:
a.htm
<a href="b.htm" target=blank>发表留言</a> <script> alert("wwwwwwwwwwwwwwwwwwwwwwwwww"); </script>
b.htm
<script language="javascript"> //window.opener.location.reload();刷新父窗口 //window.opener.location="2.htm"//重定向父窗口到2.htm页 function closewindow() { window.opener.location.reload(); self.close(); window.opener.document.write("sssssssssssssssssss"); } </script> <a href="b.htm" target=blank onclick="closewindow();">关闭</a>
后台处理方法:
private btnForSubmit(Object sender,EventArgs e) { ............. Response.Write("<script>window.opener.document.execCommand('refresh'); window.opener='';window.close();</script>"); //string str="<script>window.opener.document.execCommand('refresh'); window.opener='';window.close();</script>"; //this.RegisterStartupScript("mycode",str); external.m2_blocked()、external.m2_blocked()方法使用详解 上一页 [1] [2] [3] [4] [5] [6] 下一页 |