js常用(6)
全选
全选
function checkAll(str)
{
var a = document.getElementsByName(str);
var n = a.length;
for (var i=0; ia[i].checked = window.event.srcElement.checked;
}
function checkItem(str)
{
var e = window.event.srcElement;
var all = eval("document.hrong."+ str);
if (e.checked)
{
var a = document.getElementsByName(e.name);
all.checked = true;
for (var i=0; i{
if (!a[i].checked){ all.checked = false; break;}
}
}
else all.checked = false;
}
3.8 文件上传过程中判断文件类型
-------------------------------------------------------------------------------------
1.身份证严格验证:
2.验证IP地址
function isip(s){
var check=function(v){try{return (v<=255 && v>=0)}catch(x){return false}};
var re=s.split(".")
return (re.length==4)?(check(re[0]) && check(re[1]) && check(re[2]) && check(re[3])):false
}
var s="202.197.78.129";
alert(isip(s))
3.加sp1后还能用的无边框窗口!!
/*--- Special Thanks For andot ---*/
/*
This following code are designed and writen by Windy_sk
You can use it freely, but u must held all the copyright items!
/
/- Thanks For andot Again ---*/
var CW_width = 400;
var CW_height = 300;
var CW_top = 100;
var CW_left = 100;
var CW_url = "/";
var New_CW = window.createPopup();
var CW_Body = New_CW.document.body;
var content = "";
var CSStext = "margin:1px;color:black; border:2px outset;border-style:expression(onmouseout=onmouseup=function(){this.style.borderStyle='outset'}, onmousedown=function(){if(event.button!=2)this.style.borderStyle='inset'});background-color:buttonface;width:16px;height:14px;font-size:12px;line-height:11px;cursor:Default;";
//Build Window
include.startDownload(CW_url, function(source){content=source});
function insert_content(){
var temp = "";
CW_Body.style.overflow = "hidden";
CW_Body.style.backgroundColor = "white";
CW_Body.style.border = "solid black 1px";
content = content.replace(/]*)>/g,"");
temp += "";
temp += "";
temp += "Chromeless Window For IE6 SP1";
temp += "";
temp += "?";
temp += "0";
temp += "1";
temp += "x";
temp += "";
temp += "";
temp += content;
temp += "
";
temp += "";
CW_Body.innerHTML = temp;
相关新闻>>
- 发表评论
-
- 最新评论 更多>>