Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

³£ÓÃÕýÔò±í´ïʽ,³£ÓÃ±íµ¥ÑéÖ¤javascript´úÂë

function f_MobilCheck(as_SourceString)
{
 if(as_SourceString.match(/^13[0-9]{9}$/g)) return true;  //ÊÖ»úºÅΪ13¿ªÍ·µÄ11λÊý×Ö
 else if(as_SourceString.match(/^[0]{1}[0-9]{2,3}[2-8]{1}[0-9]{5,7}$/g)) return true;¡¡¡¡//СÁéͨΪ0¿ªÍ·µÄ3-4λµÄÇøºÅ£«²»ÒÔ1ºÍ9¿ªÍ·µÄ6£­8λÊý×Ö
 return false;
}
 
//--------ÇëÐÂÔöº¯Êýʱ¼Ó×¢ÊÍ£¬¾¡Á¿½«Í¬ÀàµÄº¯Êý·ÅÔÚÒ»Æð£¬±ãÓÚ²éÕÒ¡£------Label_NameÔÊÐíΪ¿Õ£¬ÔÚÌáʾÓëÊäÈë¿ò·ÖÀëʱʹÓá£--------
 
//-------------------------------------------ɾ³ý×Ö·û´®×ó¿Õ¸ñ£¨°üÀ¨È«½Ç¿Õ¸ñ£©----------------
function f_PubStrLTrim(as_SourceString)
{
 return as_SourceString.replace(/^[\s¡¡]*/,"");
}
//-------------------------------------------ɾ³ý×Ö·û´®ÓÒ¿Õ¸ñ£¨°üÀ¨È«½Ç¿Õ¸ñ£©-----------------
function f_PubStrRTrim(as_SourceString)
{
 return as_SourceString.replace(/[\s¡¡]*$/,"");
}
//-------------------------------------------ɾ³ý×Ö·û´®×óÓÒ¿Õ¸ñ£¨°üÀ¨È«½Ç¿Õ¸ñ£©----------------
function f_PubStrTrim(as_SourceString)
{
 return f_PubStrRTrim( f_PubStrLTrim(as_SourceString)); 
}
//-------------------------------------------ɾ³ý×Ö·û´®µÄÈ«²¿¿Õ¸ñ£¨°üÀ¨È«½Ç¿Õ¸ñ£©-----------------
function f_PubStrTrimAll(as_SourceString)
{
 return as_SourceString.replace(/[\s¡¡]*/g,"");
 
}
//---------------------------------------------ÑéÖ¤ÊÇ·ñºÏ·¨µÄµç×ÓÓÊÏ䵨ַ----ºÏ·¨£ºtrue---²»ºÏ·¨£ºfalse---------
function f_EmailCheck(as_SourceString)
{
 return as_SourceString.match(/^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/g);
}
//----------------------------------------------ÑéÖ¤ÊÇ·ñ²»º¬ÓзǷ¨µÄ×Ö·û--²»º¬ÓУ¬¼´ºÏ·¨£ºtrue---²»ºÏ·¨£ºfalse-------------
function f_StringCheck(as_SourceString)
{
 //·Ç·¨×Ö·û--£¨Ë«¼õºÅ£©/*£¨Ð±¸ÜÐǺţ©'£¨µ¥ÒýºÅ£©;£¨·ÖºÅ£©"£¨Ë«ÒýºÅ£©%£¨°Ù·ÖºÅ£©<£¨×ó¼âÀ¨ºÅ£©>£¨ÓÒ¼âÀ¨ºÅ£©
 if(as_SourceString.match(/\/\*|-{2}|[';"%<>]+/)) return false;
 else return true;
}
//------------------------------


Ïà¹ØÎĵµ£º

javascriptʵÏÖµ¯³ö´øÍ¸Ã÷Ч¹ûµÄ¿ÉÍ϶¯Í¼²ã

  javascriptʵÏÖµ¯³ö´øÍ¸Ã÷Ч¹ûµÄ¿ÉÍ϶¯Í¼²ã
      ×î¾­ÒòΪÐèÒªÒ»¸öµ¯³öͼ²ãЧ¹û£¬µ¯³öͼ²ãµ¹ÊÇÈÝÒ×ʵÏÖ£¬µ«¾ßÓÐÍ϶¯Ð§¹ûÈ´²»ÖªÔõôȥʵÏÖ£¬ÔÚÍøÉÏ×îÖÕÕÒµ½ÁËÒ»¸öÐèÒªµÄЧ¹û£¬´úÂëÒ²²»¶à£¬Ò»¿´´úÂëµÄ¾«Á¶£¬ÖªµÀÔ­×÷ÕßÓ¦¸ÃÊÇjavascript¸ßÊÖ¼¶±ðµÄÈË£¬ÏÖÔÚ¾ö¶¨½èÀ´Ò»Óã¬ÎÒ°ÑËüÂÔ¼ÓÃÀ» ......

javascriptС¼¼ÇÉ

ʼþÔ´¶ÔÏó
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
´°Ìå ......

Javascript DOMѧϰ±Ê¼Ç2


´´½¨ÎĵµÔªËØ
document.createElement(nodename)
²åÈëÔªËØµ½Îĵµ½ÚµãÊ÷
parent.appendChild(child)
´´½¨Îı¾½Úµã
document.createTextNode(text)
ÔÚÏÖÓÐÔªËØÇ°²åÈëÐÂÔªËØ
parentElement.insertBefore(newElement,targetElement)
ÔÚÏÖÓÐÔªËØºó²åÈëÐÂÔªËØ£¨×ԱຯÊý£©
parentElement.insertAfter(newElement,targe ......

Javascriptѧϰ±Ê¼ÇÒ» ¶ÔÏó

 ¼ìË÷:
1 ÓÃ||À´Ìî³äĬÈÏÖµ
var status = flight.status || "unknown";
2 ʹÓÃ&&·ÀÖ¹TypeError
flight.equipment.model //throw "TypeError"
flight.equipment && flight.equipment.model //undefined

ÒýÓÃ
var a={},b={},c={};
document.writeln(a===b); //false
Ô­ÐÍ
Javascript ......

cssºÍjavascriptÔÚIEºÍFirefoxÖжþÊ®Èý¸ö²»Í¬µã

Ò»¡¢document.formName.item(“itemName”) ÎÊÌâ
ÎÊÌâ˵Ã÷£ºIEÏ£¬¿ÉÒÔʹÓà document.formName.item(“itemName”) »ò document.formName.elements ["elementName"]£»FirefoxÏ£¬Ö»ÄÜʹÓÃdocument.formName.elements["elementName"]¡£
½â¾ö·½·¨£ºÍ³Ò»Ê¹ÓÃdocument.formName.elements["elementName" ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ