Javascript ¶ÔÏóµÄ±È½Ï
Õâ¸öËæ±ÊÆäʵÊÇΪÁ˸ÐлÇå·çЦ¸øµÄÒ»¸öÌáʾ£¬²»½ö½öÊǸæËßÎÒÔõôÅжÏÊý×飬¸üÈÃÎÒÓÐÁËÈÏÕæ¶ÁÒ»¶Á ¡¶javascriptȨÍþÖ¸ÄÏ¡·µÄÏë·¨¡£
±È½ÏºÍ¿½±´ÆäʵÊÇÒ»»ØÊ£¬´úÂëÈçÏ£º
//
//Compare object function
//
function Compare(fobj,sobj)
{
var ftype = typeof(fobj);
var stype = typeof(sobj);
if (ftype == stype)
{
if (ftype == "object")
{
if (fobj.constructor == Array && sobj.constructor == Array)//array
{
return CompareArray(fobj,sobj)
}
else if (fobj.constructor != Array && sobj.constructor != Array)//object
{
return CompareObject(fobj,sobj);
}
return false;
}
return fobj == sobj;
}
return false;
}
function CompareObject(fobj,sobj)
{
Ïà¹ØÎĵµ£º
function getCookies(name)
{
var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
if(arr != null) return unescape(arr[2]); return '';
}
function setCookie(name, value, expires,
function getCookies(name)
{
var a ......
×î½üÔÚÍøÉϲéÔÄÁ˲»ÉÙJavascript±Õ°ü(closure)Ïà¹ØµÄ×ÊÁÏ£¬Ð´µÄ´ó¶àÊǷdz£µÄѧÊõºÍרҵ¡£¶ÔÓÚ³õѧÕßÀ´Ëµ±ð˵Àí½â±Õ°üÁË£¬¾ÍÁ¬ÎÄ×ÖÐðÊö¶¼ºÜÄÑ¿´¶®¡£×«Ð´´ËÎĵÄÄ¿µÄ¾ÍÊÇÓÃ×îͨË×µÄÎÄ×Ö½Ò¿ªJavascript±Õ°üµÄÕæʵÃæÄ¿¡£
Ò»¡¢Ê²Ã´ÊDZհü£¿
“¹Ù·½”µÄ½âÊÍÊÇ£ºËùν“±Õ°ü”£¬Ö¸µÄÊÇÒ»¸öÓµÓÐÐí¶à±äÁ¿ºÍ°ó¶¨Á ......
function
Check_FileType(str)
{
var
pos
=
str.lastIndexOf(
"
.
"
);
var
lastname
=
str.substring(pos,str.length) //´Ë´¦Îļþºó׺ÃûÒ²¿ÉÓÃÊý×鷽ʽ»ñµÃstr.split(".")
if
(lastname.toLowe ......
ÓÃÒ»¸öÕý²à±í´ïʽÔÚjavascriptÖÐÑéÖ¤¾ÍÊÇ¿©!
<script language='javascript'>
function chkMail(){
if(document.form1.email.value=''){
alert("ÇëÌîдÓÊÏäµØÖ·!");
document.form1.email.focus();
return false;
}
//¿ªÊ¼ÑéÖ¤
var email = document.form1.email.value;
var pattern = /^([a-zA-Z0-9_-]) ......