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>ÆÁ±ÎÊó±êÓ ......
javascriptʼþÁбí½â˵
ʼþ ä¯ÀÀÆ÷Ö§³Ö ½â˵
Ò»°ãʼþ onclick IE3¡¢N2 Êó±êµã»÷ʱ´¥·¢´Ëʼþ
ondblclick IE4¡¢N4 Êó±êË«»÷ʱ´¥·¢´Ëʼþ
onmousedown IE4¡¢N4 °´ÏÂÊó±êʱ´¥·¢´Ëʼþ
onmouseup IE4¡¢N4 Êó±ê°´ÏºóËÉ¿ªÊó±êʱ´¥·¢´Ëʼþ
onmouseover IE3¡¢N2 µ±Êó±êÒƶ¯µ½Ä³¶ÔÏó·¶Î§µÄÉÏ·½Ê±´¥·¢´Ëʼþ
onmou ......
ʼþÔ´¶ÔÏó
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 ......
javascript typeofµÄÓ÷¨
¾³£»áÔÚjsÀïÓõ½Êý×é,±ÈÈç ¶à¸öÃû×ÖÏàͬµÄinput, ÈôÊǶ¯Ì¬Éú³ÉµÄ, Ìύʱ¾ÍÐèÒªÅжÏÆäÊÇ·ñÊÇÊý×é.
if(document.mylist.length != "undefined" ) {} Õâ¸öÓ÷¨ÓÐÎó.
ÕýÈ·µÄÊÇ if( typeof(document.mylist.length) != "undefined" ) {}
»ò if( !isNaN(document.mylist.length) ) {}
typeofµÄÔË ......
JS Check£º
javascriptlint http://www.javascriptlint.com/index.htm
jslint http://www.jslint.com/
JS UT£º
http://www.jsunit.net/
JS ST£º
http://www.outofhanwell.com/ieleak/index.php?title=Main_Page Drip
http://blogs.msdn.com/gpde/pages/javascript-memory-leak-detector.aspx
http://blogs.msdn. ......