在这里让我们一起学习,一起提高!
PCAS (Province City Area Selector 省、市、地区联动选择JS封装类) Ver 2.01 完整版

 制作时间:2005-12-30
 更新时间:2006-01-24
 数据修正:2006-08-17
 文档大小:18KB
 演示地址:本页
 应用说明:页面包含
  省市联动
    new PCAS("Province","City")
    new PCAS("Province","City","吉林省")
    new PCAS("Province","City","吉林省","吉林市")
  省市地区联动
    new PCAS("Province","City","Area")
    new PCAS("Province","City","Area","吉林省")
    new PCAS("Province","City","Area","吉林省","松原市")
    new PCAS("Province","City","Area","吉林省","松原市","宁江区")
  省、市、地区对象取得的值均为实际值。
  注:省、市、地区提示信息选项的值为""(空字符串)

省、市、地区联动选择数据

数据压缩版下载
下载文件 (已下载 1008 次)


下载未压缩版
下载文件 (已下载 963 次)


演示页面:http://jed.dzhope.com/liandong/
Tags: ,

身份证号码js验证 不指定

jed , 2009-3-16 15:45 , 代码编程 , 评论(0) , 阅读(6668) , Via 本站原创
身份证号码js验证
check_certnumber.js


function checkIdcard(idcard){
  var Errors=new Array("true","身份证号码位数不对!","身份证号码出生日期超出范围或含有非法字符!","身份证号码校验错误!","身份证号码中地区编码不正确!");
  var area={11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",21:"辽宁",22:"吉林",23:"黑龙江",31:"上海",32:"江苏",33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",42:"湖北",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",51:"四川",52:"贵州",53:"云南",54:"西藏",61:"陕西",62:"甘肃",63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外"}
  var idcard,Y,JYM;
  var S,M;
  var idcard_array = new Array();
  idcard_array = idcard.split("");
  if(idcard.length != 15 && idcard.length != 18) return Errors[1];
  //if(idcard.length != 18) return Errors[1];
  if (idcard.substr(0,6) == "000000" || idcard.substr(0,6) == "111111" || idcard.substr(0,6) == "222222" || idcard.substr(0,6) == "333333" || idcard.substr(0,6) == "444444" || idcard.substr(0,6) == "555555" || idcard.substr(0,6) == "666666" || idcard.substr(0,6) == "777777" || idcard.substr(0,6) == "888888" || idcard.substr(0,6) == "999999")  return Errors[4];
  if (idcard.substr(0,6) == "123456" || idcard.substr(0,6) == "234567" || idcard.substr(0,6) == "345678" || idcard.substr(0,6) == "456789" || idcard.substr(0,6) == "567890" || idcard.substr(0,6) == "012345" || idcard.substr(0,6) == "543210" || idcard.substr(0,6) == "432109" || idcard.substr(0,6) == "321098" || idcard.substr(0,6) == "210987" || idcard.substr(0,6) == "109876" || idcard.substr(0,6) == "098765" || idcard.substr(0,6) == "987654" || idcard.substr(0,6) == "876543" || idcard.substr(0,6) == "765432")  return Errors[4];
  if (idcard.substr(0,6) == "121212" || idcard.substr(0,6) == "131313" || idcard.substr(0,6) == "141414" || idcard.substr(0,6) == "151515" || idcard.substr(0,6) == "161616" || idcard.substr(0,6) == "171717" || idcard.substr(0,6) == "181818" || idcard.substr(0,6) == "191919" || idcard.substr(0,6) == "101010")  return Errors[4];
  if (idcard.substr(0,6) == "212121" || idcard.substr(0,6) == "232323" || idcard.substr(0,6) == "242424" || idcard.substr(0,6) == "252525" || idcard.substr(0,6) == "262626" || idcard.substr(0,6) == "272727" || idcard.substr(0,6) == "282828" || idcard.substr(0,6) == "292929" || idcard.substr(0,6) == "202020")  return Errors[4];
  if (idcard.substr(0,6) == "313131" || idcard.substr(0,6) == "323232" || idcard.substr(0,6) == "343434" || idcard.substr(0,6) == "353535" || idcard.substr(0,6) == "363636" || idcard.substr(0,6) == "373737" || idcard.substr(0,6) == "383838" || idcard.substr(0,6) == "393939" || idcard.substr(0,6) == "303030")  return Errors[4];
  if (idcard.substr(0,6) == "414141" || idcard.substr(0,6) == "424242" || idcard.substr(0,6) == "434343" || idcard.substr(0,6) == "454545" || idcard.substr(0,6) == "464646" || idcard.substr(0,6) == "474747" || idcard.substr(0,6) == "484848" || idcard.substr(0,6) == "494949" || idcard.substr(0,6) == "404040")  return Errors[4];
  if (idcard.substr(0,6) == "515151" || idcard.substr(0,6) == "525252" || idcard.substr(0,6) == "535353" || idcard.substr(0,6) == "545454" || idcard.substr(0,6) == "565656" || idcard.substr(0,6) == "575757" || idcard.substr(0,6) == "585858" || idcard.substr(0,6) == "595959" || idcard.substr(0,6) == "505050")  return Errors[4];
  if (idcard.substr(0,6) == "616161" || idcard.substr(0,6) == "626262" || idcard.substr(0,6) == "636363" || idcard.substr(0,6) == "646464" || idcard.substr(0,6) == "656565" || idcard.substr(0,6) == "676767" || idcard.substr(0,6) == "686868" || idcard.substr(0,6) == "696969" || idcard.substr(0,6) == "606060")  return Errors[4];
  if (idcard.substr(0,6) == "717171" || idcard.substr(0,6) == "727272" || idcard.substr(0,6) == "737373" || idcard.substr(0,6) == "747474" || idcard.substr(0,6) == "757575" || idcard.substr(0,6) == "767676" || idcard.substr(0,6) == "787878" || idcard.substr(0,6) == "797979" || idcard.substr(0,6) == "707070")  return Errors[4];
  if (idcard.substr(0,6) == "818181" || idcard.substr(0,6) == "828282" || idcard.substr(0,6) == "838383" || idcard.substr(0,6) == "848484" || idcard.substr(0,6) == "858585" || idcard.substr(0,6) == "868686" || idcard.substr(0,6) == "878787" || idcard.substr(0,6) == "898989" || idcard.substr(0,6) == "808080")  return Errors[4];
  if (idcard.substr(0,6) == "919191" || idcard.substr(0,6) == "929292" || idcard.substr(0,6) == "939393" || idcard.substr(0,6) == "949494" || idcard.substr(0,6) == "959595" || idcard.substr(0,6) == "969696" || idcard.substr(0,6) == "979797" || idcard.substr(0,6) == "989898" || idcard.substr(0,6) == "909090")  return Errors[4];

  if(area[parseInt(idcard.substr(0,2))]==null) return Errors[4];
  switch(idcard.length){
    case 15:
    if ((parseInt(idcard.substr(6,2))+1900) % 4 == 0 || ((parseInt(idcard.substr(6,2))+1900) % 100 == 0 && (parseInt(idcard.substr(6,2))+1900) % 4 == 0 )){
      ereg = /^[1-9][0-9]{5}[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))[0-9]{3}$/;//测试出生日期的合法性
    }
    else{
      ereg = /^[1-9][0-9]{5}[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|1[0-9]|2[0-8]))[0-9]{3}$/;//测试出生日期的合法性
    }
    if(ereg.test(idcard))
      return Errors[0];
    else
      return Errors[2];
    break;
    case 18:
      if ( parseInt(idcard.substr(6,4)) % 4 == 0 || (parseInt(idcard.substr(6,4)) % 100 == 0 && parseInt(idcard.substr(6,4))%4 == 0 )){
        ereg = /^[1-9][0-9]{5}19[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|[1-2][0-9]))[0-9]{3}[0-9Xx]$/;//闰年出生日期的合法性正则表达式
      }
      else{
        ereg = /^[1-9][0-9]{5}19[0-9]{2}((01|03|05|07|08|10|12)(0[1-9]|[1-2][0-9]|3[0-1])|(04|06|09|11)(0[1-9]|[1-2][0-9]|30)|02(0[1-9]|1[0-9]|2[0-8]))[0-9]{3}[0-9Xx]$/;//平年出生日期的合法性正则表达式
      }
      if(ereg.test(idcard)){
        S = (parseInt(idcard_array[0]) + parseInt(idcard_array[10])) * 7 + (parseInt(idcard_array[1]) + parseInt(idcard_array[11])) * 9 + (parseInt(idcard_array[2]) + parseInt(idcard_array[12])) * 10 + (parseInt(idcard_array[3]) + parseInt(idcard_array[13])) * 5 + (parseInt(idcard_array[4]) + parseInt(idcard_array[14])) * 8 + (parseInt(idcard_array[5]) + parseInt(idcard_array[15])) * 4 + (parseInt(idcard_array[6]) + parseInt(idcard_array[16])) * 2 + parseInt(idcard_array[7]) * 1 + parseInt(idcard_array[8]) * 6 + parseInt(idcard_array[9]) * 3 ;
        Y = S % 11;
        M = "F";
        JYM = "10X98765432";
        M = JYM.substr(Y,1);
        if(M == idcard_array[17])
          return Errors[0];
        else
          return Errors[3];
      }
      else
        return Errors[2];
      break;
  default:
    return Errors[1];
    break;
  }
}




test.html  例子代码



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>身份证号码js验证</title>
<script type="text/javascript" src="check_certnumber.js"></script>
<script type="text/javascript">
////身份证号码验证
  function v_cert_number(theForm){    
      var check_result = checkIdcard(theForm.cardid.value);
      if (check_result != "true"){
        document.getElementById("cert_number_div").style.color="#ff0000";
        document.getElementById("cert_number_div").innerHTML ="<image src='images/Img227876837.gif'>&nbsp;"+check_result;
        return false;  
      }    
      document.getElementById("cert_number_div").innerHTML ="<image src='images/Img227876838.gif'>身份证号码正确,需要人工验证身份号和姓名是否相符!";
  }  

////
</script>
<script>
    function validateform()
    {    
      var check_result = checkIdcard(reg.cardid.value);
      if (check_result != "true"){
          window.alert (check_result)
          reg.cardid.focus()
          return false;
         }
     }
</script>
</head>

<body>
<form action="real.php?type=upinfo" method="post"  name="reg" onSubmit="return validateform();">
<INPUT onblur=javascript:v_cert_number(document.reg) name=cardid>
<DIV class=f1 id=cert_number_div align=left>请如实填写身份证号,作为实名认证的主要依据,如果末位字符是X,则必须输入大写X</DIV>
</form>
</body>
</html>




js对文字进行编码涉及3个函数:escape,encodeURI,encodeURIComponent,相应3个解码函数:unescape,decodeURI,decodeURIComponent

1、  传递参数时需要使用encodeURIComponent,这样组合的url才不会被#等特殊字符截断。                            

例如:



<script language="javascript">document.write('<a href="http://passport.baidu.com/?logout&aid=7&u='+encodeURIComponent("http://cang.baidu.com/bruce42")+'">退出</a>');</script>



2、  进行url跳转时可以整体使用encodeURI

例如: Location.href=encodeURI(http://cang.baidu.com/do/s?word=中国asp之家&ct=21);
3、  js使用数据时可以使用escape

例如:搜藏中history纪录。

4、  escape对0-255以外的unicode值进行编码时输出%u****格式,其它情况下escape,encodeURI,encodeURIComponent编码结果相同。

最多使用的应为encodeURIComponent,它是将中文、韩文等特殊字符转换成utf-8格式的url编码,所以如果给后台传递参数需要使用encodeURIComponent时需要后台解码对utf-8支持(form中的编码方式和当前页面编码方式相同)

(中国asp之家注:就是说如果你的页面编码是gb2312的话,服务器端接收的将是乱码)

escape不编码字符有69个:*,+,-,.,/,@,_,0-9,a-z,A-Z

encodeURI不编码字符有82个:!,#,$,&,',(,),*,+,,,-,.,/,:,;,=,?,@,_,~,0-9,a-z,A-Z

encodeURIComponent不编码字符有71个:!, ',(,),*,-,.,_,~,0-9,a-z,A-Z

附上这个三个函数的介绍:

escape 方法

对 String 对象编码以便它们能在所有计算机上可读,

escape(charString)
必选项 charstring 参数是要编码的任意 String 对象或文字。

说明
escape 方法返回一个包含了 charstring 内容的字符串值( Unicode 格式)。所有空格、标点、重音符号以及其他非 ASCII 字符都用 %xx 编码代替,其中 xx 等于表示该字符的十六进制数。例如,空格返回的是 "%20" 。

字符值大于 255 的以 %uxxxx 格式存储。

注意   escape 方法不能够用来对统一资源标示码 (URI) 进行编码。对其编码应使用 encodeURI 和encodeURIComponent 方法。

encodeURI 方法

将文本字符串编码为一个有效的统一资源标识符 (URI)。

encodeURI(URIString)
必选的 URIString 参数代表一个已编码的 URI。

说明
encodeURI 方法返回一个编码的 URI。如果您将编码结果传递给 decodeURI,那么将返回初始的字符串。encodeURI 方法不会对下列字符进行编码:":"、"/"、";" 和 "?"。请使用 encodeURIComponent 方法对这些字符进行编码。

encodeURIComponent 方法

将文本字符串编码为一个统一资源标识符 (URI) 的一个有效组件。

encodeURIComponent(encodedURIString)
必选的 encodedURIString 参数代表一个已编码的 URI 组件。

说明

encodeURIComponent 方法返回一个已编码的 URI。如果您将编码结果传递给 decodeURIComponent,那么将返回初始的字符串。因为 encodeURIComponent 方法对所有的字符编码,请注意,如果该字符串代表一个路径,例如 /folder1/folder2/default.html,其中的斜杠也将被编码。这样一来,当该编码结果被作为请求发送到 web 服务器时将是无效的。如果字符串中包含不止一个 URI 组件,请使用 encodeURI 方法进行

Tags: , ,
escape() 方法:
采用ISO Latin字符集对指定的字符串进行编码。所有的空格符、标点符号、特殊字符以及其他非ASCII字符都将被转化成%xx格式的字符编码(xx等于该字符在字符集表里面的编码的16进制数字)。比如,空格符对应的编码是%20。unescape方法与此相反。不会被此方法编码的字符: @ * / +
英文解释:MSDN JScript Reference: The escape method returns a string value (in Unicode format) that contains the contents of [the argument]. All spaces, punctuation, accented characters, and any other non-ASCII characters are replaced with %xx encoding, where xx is equivalent to the hexadecimal number representing the character. For example, a space is returned as "%20."
Edge Core Javascript Guide: The escape and unescape functions let you encode and decode strings. The escape function returns the hexadecimal encoding of an argument in the ISO Latin character set. The unescape function returns the ASCII string for the specified hexadecimal encoding value.

encodeURI() 方法:把URI字符串采用UTF-8编码格式转化成escape格式的字符串。不会被此方法编码的字符:! @ # $& * ( ) = : / ; ? + '
英文解释:MSDN JScript Reference: The encodeURI method returns an encoded URI. If you pass the result to decodeURI, the original string is returned. The encodeURI method does not encode the following characters: ":", "/", ";", and "?". Use encodeURIComponent to encode these characters. Edge Core Javascript Guide: Encodes a Uniform Resource Identifier (URI) by replacing each instance of certain characters by one, two, or three escape sequences representing the UTF-8 encoding of the character

encodeURIComponent() 方法:把URI字符串采用UTF-8编码格式转化成escape格式的字符串。与encodeURI()相比,这个方法将对更多的字符进行编码,比如 / 等字符。所以如果字符串里面包含了URI的几个部分的话,不能用这个方法来进行编码,否则 / 字符被编码之后URL将显示错误。不会被此方法编码的字符:! * ( )
英文解释:MSDN JScript Reference: The encodeURIComponent method returns an encoded URI. If you pass the result to decodeURIComponent, the original string is returned. Because the encodeURIComponent method encodes all characters, be careful if the string represents a path such as /folder1/folder2/default.html. The slash characters will be encoded and will not be valid if sent as a request to a web server. Use the encodeURI method if the string contains more than a single URI component. Mozilla Developer Core Javascript Guide: Encodes a Uniform Resource Identifier (URI) component by replacing each instance of certain characters by one, two, or three escape sequences representing the UTF-8 encoding of the character.

因此,对于中文字符串来说,如果不希望把字符串编码格式转化成UTF-8格式的(比如原页面和目标页面的charset是一致的时候),只需要使用escape。如果你的页面是GB2312或者其他的编码,而接受参数的页面是UTF-8编码的,就要采用encodeURI或者encodeURIComponent。

另外,encodeURI/encodeURIComponent是在javascript1.5之后引进的,escape则在javascript1.0版本就有。

英文注释:The escape() method does not encode the + character which is interpreted as a space on the server side as well as generated by forms with spaces in their fields. Due to this shortcoming, you should avoid use of escape() whenever possible. The best alternative is usually encodeURIComponent().Use of the encodeURI() method is a bit more specialized than escape() in that it encodes for URIs [REF] as opposed to the querystring, which is part of a URL. Use this method when you need to encode a string to be used for any resource that uses URIs and needs certain characters to remain un-encoded. Note that this method does not encode the ' character, as it is a valid character within URIs.Lastly, the encodeURIComponent() method should be used in most cases when encoding a single component of a URI. This method will encode certain chars that would normally be recognized as special chars for URIs so that many components may be included. Note that this method does not encode the ' character, as it is a valid character within URIs.


Tags: , ,

js替换应用 不指定

jed , 2008-9-17 11:29 , 代码编程 , 评论(0) , 阅读(5310) , Via 本站原创


<script language="javascript">
var str="</SheetItems><ElectricalStatus>";
str=str.replace(/\</g,"!");
alert(str);
</script>

Tags:
十分好用的js代码,能够屏蔽Alt+方向键,F5刷新键,退格键,还有CTR+N,shift+F10,F11等键

<script>  
  function   document.onkeydown()   {          
      if   ((window.event.altKey)&&    
              ((window.event.keyCode==37)||       //屏蔽   Alt+   方向键   ←    
                (window.event.keyCode==39))){     //屏蔽   Alt+   方向键   →    
            alert("软件不支持你使用ALT+方向键前进或后退!");    
            event.returnValue=false;    
            }    
      if   ((event.keyCode==8)||                         //屏蔽退格删除键    
              (event.keyCode==116)){                     //屏蔽   F5   刷新键    
            event.keyCode=0;    
            event.returnValue=false;    
            }    
      if   ((event.ctrlKey)&&(event.keyCode==78)){       //屏蔽   Ctrl+n    
            event.returnValue=false;    
            }    
      if   ((event.shiftKey)&&(event.keyCode==121)){   //屏蔽   shift+F10    
            event.returnValue=false;    
            }    
      if   (event.keyCode==122){   //屏蔽   F11    
            event.returnValue=false;    
            }    
      }
  function   document.onfocus(){
      if   ((window.event.altKey)&&    
              ((window.event.keyCode==37)||       //屏蔽   Alt+   方向键   ←    
                (window.event.keyCode==39))){     //屏蔽   Alt+   方向键   →    
            alert("软件不支持你使用ALT+方向键前进或后退!");    
            event.returnValue=false;    
            }    
      if   ((event.keyCode==8)||                         //屏蔽退格删除键    
              (event.keyCode==116)){                     //屏蔽   F5   刷新键    
            event.keyCode=0;    
            event.returnValue=false;    
            }    
      if   ((event.ctrlKey)&&(event.keyCode==78)){       //屏蔽   Ctrl+n    
            event.returnValue=false;    
            }    
      if   ((event.shiftKey)&&(event.keyCode==121)){   //屏蔽   shift+F10    
            event.returnValue=false;    
            }    
      if   (event.keyCode==122){   //屏蔽   F11    
            event.returnValue=false;    
            }    
      }
  </script>  


Tags: ,
大家一定遇到过网页内容无法复制的问题,虽然实现技术简单,但碰到时还真是挺烦人的,现在偶提供两个最迅速的解决方案
方法1:
推荐大家使用基于IE内核的浏览器--世界之窗(The world),具备解除页面脚本屏蔽复制的功能,现同解除页面右键菜单限制功能一起,在其它选项中可设置,名称为:解除页面脚本限制(复制、右键菜单等)
1.*版本下载地址:http://www.ioage.com/cn/theworld_download.htm
2.*版本下载地址:http://www.ioage.com/download/TheWorld2.0Beta_cnxp
方法2:
就是在浏览器地址栏输入以下代码:

javascript:alert(document.onselectstart = document.oncontextmenu = document.onmousedown = document.onkeydown = function(){return true;});



嘿嘿,是不是可以选中内容可以复制了?神奇吧!

说到灵感来源,还要从前几天在发布的一特搞笑的技术说起(原文地址:http://www.dzhai.com/blog/article.asp?id=133),它是通过在地址栏输入javascript代码而使得网页中的图片满天飞舞,效果很是不错。虽然很容易明白其原理,但还是很佩服该作者的创意,呵呵。。于是便想这个小trick是否能有其他实用的用处呢。。。

说到这里,大家都明白了,就是用来解决网页能容无法复制的问题。

首先了解下常见的实现无法复制内容的javascript技术,如下:
屏蔽鼠标右键

在body 中加入


oncontextmenu="return false;"





<html>      
 <head>      
     <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312">      
     <noscript><meta   http-equiv="refresh"   content="0;url=about:noscript"></noscript>      
     <title>屏蔽鼠标右键、Ctrl+N、Shift+F10、Alt+F4、F11、F5刷新、退格键</title>      
 </head>      
 <body>      
 <script   language="Javascript"><!--      
     //屏蔽鼠标右键、Ctrl+N、Shift+F10、F11、F5刷新、退格键      
     //Author:   meizz(梅花雨)   2002-6-18      
 function   document.oncontextmenu(){event.returnValue=false;}//屏蔽鼠标右键      
 function   window.onhelp(){return   false}   //屏蔽F1帮助      
 function   document.onkeydown()      
 {      
     if   ((window.event.altKey)&&      
             ((window.event.keyCode==37)||       //屏蔽   Alt+   方向键   ←      
               (window.event.keyCode==39)))       //屏蔽   Alt+   方向键   →      
     {      
           alert("不准你使用ALT+方向键前进或后退网页!");      
           event.returnValue=false;      
     }      
           /*   注:这还不是真正地屏蔽   Alt+   方向键,      
           因为   Alt+   方向键弹出警告框时,按住   Alt   键不放,      
           用鼠标点掉警告框,这种屏蔽方法就失效了。以后若      
           有哪位高手有真正屏蔽   Alt   键的方法,请告知。*/      
     if   ((event.keyCode==8)     ||                                   //屏蔽退格删除键      
             (event.keyCode==116)||                                   //屏蔽   F5   刷新键      
             (event.ctrlKey   &&   event.keyCode==82)){   //Ctrl   +   R      
           event.keyCode=0;      
           event.returnValue=false;      
           }      
     if   (event.keyCode==122){event.keyCode=0;event.returnValue=false;}     //屏蔽F11      
     if   (event.ctrlKey   &&   event.keyCode==78)   event.returnValue=false;       //屏蔽   Ctrl+n      
     if   (event.shiftKey   &&   event.keyCode==121)event.returnValue=false;     //屏蔽   shift+F10      
     if   (window.event.srcElement.tagName   ==   "A"   &&   window.event.shiftKey)        
             window.event.returnValue   =   false;                           //屏蔽   shift   加鼠标左键新开一网页      
     if   ((window.event.altKey)&&(window.event.keyCode==115))                           //屏蔽Alt+F4      
     {      
             window.showModelessDialog("about:blank","","dialogWidth:1px;dialogheight:1px");      
             return   false;      
     }      
 }      
 </script>      
 屏蔽鼠标右键、Ctrl+N、Shift+F10、Alt+F4、F11、F5刷新、退格键      
 </body>      
 </html>    


完全去除页面滚动条的方法 不指定

jed , 2008-4-8 09:50 , 代码编程 , 评论(1) , 阅读(6264) , Via 本站原创
今天做站的时候客户要求实现网站全屏,使用JavaScript:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<script language="javascript">
  <!--
function fullscreen(){
window.open("/index.htm","","scrollbars=0,toolbar=0,location=0,fullscreen=1,directories=0,status=0,menubar=0,resizable=0");
}
  // -->
</script>
</head>
<body>
<h3 align="center"><a href="j avascript:fullscreen()">打开</a></h3>
</body>
</html>

Tags: ,
分页: 1/2 第一页 1 2 下页 最后页 [ 显示模式: 摘要 | 列表 ]