javascriptÑéÖ¤3
/*
ÏÞÖÆÊäÈë×Ö·ûµÄλÊý
strÊÇÓû§ÊäÈë×Ö·û´®£¬lenÊÇÒªÏÞÖÆµÄλÊý
----------------------------
*/
function isSmall(str,len){
if (str.length<len){
return(true);
}else{
return(false);
}
}
/*ÅжÏÁ½¸ö×Ö·û´®ÊÇ·ñÒ»ÖÂ
---------------------------------
*/
function isSame(str1,str2){
if (str1==str2){
return(true);
}else{
return(false);
}
}
/*
ÅжÏ×Ö·û´®ÊÇ·ñΪ¿Õ¿ªÊ¼
---------------------------------
*/
function isNotNull(str){
if (str.length==""){
return(false);
}else{
return(true);
}
}
/*
ÅжÏÊDz»ÊÇÊÖ»úºÅÂë
---------------------------------
*/
function isPhone(str){
reg=/^[0]?13\d{9}$/gi;
reg2=/^[0]?15\d{9}$/gi;
if(!reg.test(str)&&!reg2.test(str)){
return false;
}
return true;
}
/*
ÅжÏÓû§ÃûÊÇ·ñ²»°üº¬ºº×Ö
£¨Óû§Ãû²»ÄÜΪºº×Ö£¬Ò²²»×¼´øÓÐÌØÊâ×Ö·û£©
×¢£º
ÕýÔò±í´ïʽ.test() ·½·¨ÓÃÓÚ¼ì²âÒ»¸ö×Ö·û´®ÊÇ·ñÆ¥Åäij¸öģʽ
---------------------------------
*/
function notChinese(str){
var reg=/[^A-Za-z0-9_]/g
if (reg.test(str)){
return (false);
}else{
return(true);
}
}
/*
ÅжÏÊÇ·ñΪÈÕÆÚ
----------------------------------
*/
function isDate (theStr) {
var the1st = theStr.indexOf('-');
var the2nd = theStr.lastInde
Ïà¹ØÎĵµ£º
//ÎÞģʽµÄÌáʾ¿ò
//ÆÁ±Î°´¼ü
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<noscript><meta http-equiv="refresh" content="0;url=about:noscript"></noscript>
<title>ÆÁ±ÎÊó±êÓ ......
ʼþÔ´¶ÔÏó
event.srcElement.tagName
event.srcElement.type
²¶»ñÊÍ·Å
event.srcElement.setCapture();
event.srcElement.releaseCapture();
ʼþ°´¼ü
event.keyCode
event.shiftKey
event.altKey
event.ctrlKey
ʼþ·µ»ØÖµ
event.returnValue
Êó±êλÖÃ
event.x
event.y
´°Ìå»î¶¯ÔªËØ
d ......
1¡¡¾Ö²¿´òÓ¡·½·¨£º
×÷Ó㺽«idΪdayinµÄÄÚÈÝ£¬Ð½¨Ò³Ãæ²¢´òÓ¡£¬¿É½â¾ö´òÓ¡Ä³Ò³ÃæÖеIJ¿·ÖÄÚÈݵÄÎÊÌâ¡£
ʹÓ÷½·¨£º½«Òª´òÓ¡µÄÄÚÈÝͨ¹ý <span id="dayin"></span>°üº¬ÆðÀ´£¬È»ºóÔÚij¸ö°´Å¤Öж¨Òå
ʼþ
<input type="button" onclick="dayin()" value="´òÓ¡">
function dayin()
{
......
//the common event,If your brower is firefox,you should use this function instead of "window.event"
function getEvent() {
if(document.all)
return window.event; //get ie event
func=getEvent.caller;
while(func!=null) {
......
function $id(s) {
return document.getElementById(s);
}
//ÅжÏСÊý
function IsFloat(s) {
if (!/^[+\-]?\d+(.\d+)?$/.test(s))
return false;
else
return ......