窗口最大化

常用JavaScript(二)<body onload="window.resizeTo(window.screen.width - 4,window.screen.height-50);window.moveTo(-4,-4)"> 

禁止右键

 

禁止保存 <noscript><iframe src="*.htm"></iframe></noscript>
禁止选取<body oncontextmenu="return false" ondragstart="return false" onselectstart ="return false"
onselect="document.selection.empty)" oncopy="document.selection.empty)" onbeforecopy=
"return false"onmouseup="document.selection.empty()>
禁止粘贴<input type=text onpaste="return false">

 根据宽度换行 style="word-break:break-all"

//消除图像工具栏

常用JavaScript(二)<IMG src="mypicture.jpg" temp_src="mypicture.jpg" HEIGHT="100px" WIDTH="100px" GALLERYIMG="false">  
常用JavaScript(二)or 
常用JavaScript(二)
<head> 
常用JavaScript(二)
<meta http-equiv="imagetoolbar" content="no"> 
常用JavaScript(二)
</head> 
常用JavaScript(二)

//取得控件得绝对位置(1)

常用JavaScript(二)<script language="javascript">  <br />
常用JavaScript(二)
function getoffset(e) <br />

[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
//获得控件的绝对位置(2)
oRect = obj.getBoundingClientRect();
oRect.left
oRect.




1 父子页面的值传递
两种方式:
     1)在父页面可以通过pagename操作子页面。
       pagename = window.open('page ','name','width,height'); pagename.focus();
        在子页面可以通过parents.Label.innerText = '"value"'
     2)通过模态对话框返回值。当执行模态对话框时,父页面将停止操作。
        在父页面
          var result = showModalDialog(url,window,"dialogWidth:"+width+"px;dialogHeight:"+height+"px;help:no;scroll:no;status:no");
          alert(result)
        在子页面
            <script language='javascript'>
                  window.returnValue = 'True';
                  window.close()
             </script>
      3) 通过vArguments将父窗体的值传递到子窗体
      <script>
             var obj = new Object();
             obj.name="51js";
             window.showModalDialog   ("modal.htm",obj,"dialogWidth=200px;dialogHeight=100px");
       </script>
       modal.htm
        <script>
            var obj = window.dialogArguments
            alert("您传递的参数为:" + obj.name)
          </script>
      4) 子窗体使父窗体刷新
         opener.window.location.reload();
      5) 避免提交时弹出另一个页面
   <head>标签里加入<base target="_self">
      6) 避免模式窗体不刷新
    Response.Expires = -1
    Response.ExpiresAbsolute = Now() - 1
    Response.cachecontrol = "no-cache"
2 将javascript值赋给session
     新建一个框架,不让他显示出来。在页面里
     document.all('djTmp').src="djTmp.aspx?name=RoleName&value=" + document.all('cboRole').value
     在框架网页里
        Dim strName As String = Request.QueryString("name")
        Dim strValue As String = Request.QueryString("value")
        Session(strName) = strValue
3 服务器控件取js值。
    新建一隐藏控件。将其设为服务器端运行,这样通过脚本和服务器都可以访问。

参考:http://neozhu.cnblogs.com/archive/2005/07/28/201838.aspx
      http://www.phpx.com/happy/showthread.php?threadid=101722&goto=nextnewest

 

相关文章:

  • 2022-01-19
  • 2022-12-23
  • 2021-07-30
  • 2021-06-25
  • 2022-01-18
猜你喜欢
  • 2021-12-31
  • 2021-07-10
  • 2022-12-23
  • 2021-11-28
  • 2021-11-16
  • 2021-12-19
相关资源
相似解决方案