加入收藏
联系我们
关于我们
 您现在的位置: 亿聪 >> 网络学院 >> 网络编程 >> JavaScript >> 正文  
  BS开发中常用的Javascript技术         
BS开发中常用的Javascript技术
[ 作者:未知    转贴自:未知    点击数:20540    更新时间:2004/12/15    文章录入:亿聪 ]


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]  下一页

  • 上一篇文章: 二级联动菜单详解

  • 下一篇文章: 没有了
  • 发表评论】【告诉好友】【打印此文】【关闭窗口
     最新5篇热点文章
  • Knoppix 4.0.2 免硬盘免安…[15103]

  • 通过ASP记录进行分页[19288]

  • ASP开发准则[11238]

  • ASP组件指南[11210]

  • ASP指南[11225]

  •  
     最新5篇推荐文章
  • Knoppix 4.0.2 免硬盘免安…[15103]

  • 如何让Win 2003系统更加安…[12467]

  • Nero超刻简明教程[33947]

  • PS商业实战-来杯茶,行吗?…[7085]

  • ASP深度揭密(下)[12221]

  •  
     相 关 文 章
  • 常用javascript代码[5830]


  •   网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
        没有任何评论
    设为首页 | 加入收藏 | 关于我们 | 联系我们 | 友情链接 | 版权声明 | 管理登录
    Copyright © 2000-2022 Yicong.com.All Rights Reserved.
    亿聪 版权所有 E-mail: