javascript ÕýÔò±í´ïʽÏê½â
function isTrueName(s) { var patrn=/^[a-zA-Z]{1,30}$/; if (!patrn.exec(s)) return false return true } }} //УÑéÃÜÂ룺ֻÄÜÊäÈë6-20¸ö×Öĸ¡¢Êý×Ö¡¢Ï»®Ïß
function isPasswd(s)
{
var patrn=/^(\w){6,20}$/;
if (!patrn.exec(s)) return false
return true
}
//УÑéÆÕͨµç»°¡¢´«ÕæºÅÂ룺¿ÉÒÔ“+”¿ªÍ·£¬³ýÊý×ÖÍ⣬¿Éº¬ÓГ-”
function isTel(s)
{
//var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?(\d){1,12})+$/;
var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;
if (!patrn.exec(s)) return false
return true
}
//УÑéÊÖ»úºÅÂ룺±ØÐëÒÔÊý×Ö¿ªÍ·£¬³ýÊý×ÖÍ⣬¿Éº¬ÓГ-”
function isMobil(s)
{
var patrn=/^[+]{0,1}(\d){1,3}[ ]?([-]?((\d)|[ ]){1,12})+$/;
if (!patrn.exec(s)) return false
return true
}
//УÑéÓÊÕþ±àÂë
function isPostalCode(s)
{
//var patrn=/^[a-zA-Z0-9]{3,12}$/;
var patrn=/^[a-zA-Z0-9 ]{3,12}$/;
if (!patrn.exec(s)) return false
return true
}
//УÑéËÑË÷¹Ø¼ü×Ö
function isSearch(s)
{
var patrn=/^[^`~!@#$%^&*()+=|\\\][\]\{\}:;'\,.<>/?]{1}[^`~!@$%^&()+=|\\\]
[\]\{\}:;'\,.<>?]{0,19}$/;
if (!patrn.exec(s)) return false
return true
}
function isIP(s) //by zergling
{
var patrn=/^[0-9.]{1,20}$/;
if (!patrn.exec(s)) return false
return true
}
ÕýÔò±í´ïʽ
"^\\d+$"¡¡¡¡//·Ç¸ºÕûÊý£¨ÕýÕûÊý + 0£©
"^[0-9]*[1-9][0-9]*$"¡¡¡¡//ÕýÕûÊý
"^((-\\d+)|(0+))$"¡¡¡¡//·ÇÕýÕûÊý£¨¸ºÕûÊý + 0£©
"^-[0-9]*[1-9][0-9]*$"¡¡¡¡//¸ºÕûÊý
"^-?\\d+$"¡¡¡¡¡¡¡¡//ÕûÊý
"^\\d+(\\.\\d+)?$"¡¡¡¡//·Ç¸º¸¡µãÊý£¨Õý¸¡µãÊý + 0£©
"^(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*))$"¡¡
//Õý¸¡µãÊý
"^((-\\d+(\\.\\d+)?)|(0+(\\.0+)?))$"¡¡¡¡//·ÇÕý¸¡µãÊý£¨¸º¸¡µãÊý + 0£©
"^(-(([0-9]+\\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\\.[0-9]+)|([0-9]*[1-9][0-9]*)))$"¡¡
//¸º¸¡µãÊý
"^(-?\\d+)(\\.\\d+)?$"¡¡¡¡//¸¡µãÊý
"^[A-Za-z]+$"¡¡¡¡//ÓÉ26¸öÓ¢ÎÄ×Öĸ×é³ÉµÄ×Ö·û´®
"^[A-Z]+$
Ïà¹ØÎĵµ£º
javascriptÖÐÓÐÒ»ÖÖ·½·¨½Ð×ö·º»¯·½·¨£¬Ö¸ÄÇÖÖÔÉú¶ÔÏ󲻿ɱéÀúµÄÔÐÍ·½·¨¡£ÈçArrayµÄpop£¬sliceµÈ¡£ÎÒÃDZØÐëÖªµÀËüÃǵÄÃû×Ö²ÅÄܵ÷ÓÃËü»òÕß°ÑËüÍÚ³öÀ´¡£¼ÙÈçÎÒÃÇÏëÉè¼ÆÒ»¸öÀ࣬ӵÓÐÓëStringͬÑùµÄ¹¦ÄÜ£¬ÎÒÃǾÍÓÐÕâÐèÒª¡£²»Èç·Å¿ªµã˵£¬ÎªÊ²Ã´ÒªÉè¼ÆÕâ¸öÀà°É£¬ÏÔÈ»String2µÄЧÂʲ»ÈçÔÉúµÄ£¬µ«ÊÂÇé×ÜÒªÍùÁ½Ãæ¿´¡£ÕýÈçC#²»Èç¶þ ......
.×Ö·û´®(String)
1.ÉùÃ÷
var myString = new String("Every good boy does fine.");
var myString = "Every good boy does fine.";
2.×Ö·û´®Á¬½Ó
var myString = "Every " + "goo ......
javascript
ʼþÁбí½â˵
ʼþ
ä¯ÀÀÆ÷Ö§³Ö
½â˵
Ò»°ãʼþ
onclick
IE3¡¢N2
Êó±êµã»÷ʱ´¥·¢´Ëʼþ
ondblclick
IE4¡¢N4
Êó±êË«»÷ʱ´¥·¢´Ëʼþ
onmousedown
IE4¡¢N4
°´ÏÂÊó±êʱ´¥·¢´Ëʼþ
onmouseup
IE4¡¢N4
Êó±ê°´ÏºóËÉ¿ªÊó±êʱ´¥·¢´Ëʼþ
onmouseover
IE3¡¢N2
µ±Êó±êÒƶ¯µ½Ä³¶ÔÏ ......
Google ÅÅÃûÖÐµÄ 10 ¸ö×îÖøÃûµÄ JavaScript ¿â ÊÕ²Ø
JavaScript ÊÇ Web ¿ª·¢ÓëÉè¼ÆÖв»¿É»òȱµÄ¶«Î÷£¬²»¹ÜÊÇÒ»¸ö¼òµ¥µÄÍøÒ³»¹ÊÇÒ»¸öרҵµÄÕ¾µã£¬Ò²²»¹ÜÄãÊǸßÊÖ»¹ÊDzËÄñ£¬Èç½ñ JavaScript ¿âÔ½À´Ô½Ç¿´ó£¬¿ÉÒÔʤÈÎÐí¶à¸´ÔӵŤ×÷£¬È»¶øͬʱ£¬ÈËÃÇÔÚÖÚ¶à JavaScript ¿âÃæÇ°ÓÖ¾õµÃÎÞËùÊÊ´Ó£¬±¾ÎÄ£¬ÎÒÃǽ«Ê¹Óà G ......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ÑéÖ¤Êý×Ö×î¼òµ¥<a href="http://www.jb51.net/list/list_6_1.htm" tar ......