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

JavaScript³£Ó÷½·¨×ܽᗗ¼¸¸ö±íµ¥ÑéÖ¤µÄ

¼¸¸ö±íµ¥ÑéÖ¤µÄ
function checkMail(obj,error)
{
if (obj == null)
return "NULL";
if (obj.value == "")
return "EMPTY";
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (filter.test(obj.value))
return true;
else
alert(error);
return false;
}
function verifyDottedIP(cntrl,errmsg1,errmsg2,flag)
{
ip_str = cntrl.value;
if (ip_str == "") {
if (flag == 1){
alert(errmsg1);
cntrl.select();
return false;
}
return true;
}else{
varval = 0;
vari = index = 0;
while (index < ip_str.lastIndexOf(".")){
k = index;
index = ip_str.indexOf(".", index);
val = toNumber(ip_str, k, index);
if (val < 0 || val > 255)
break;
i++; index++;
}
if (i == 3){
if (index == ip_str.length){
i = 2;
} else {
val = toNumber(ip_str,index, ip_str.length);
if (val < 0 || val > 255) i = 2;
}
}
if (i != 3) {
alert(errmsg2);
cntrl.select();
return false;
}
}
return true;
}
function verifyport(cntrl,errmsg1,errmsg2,flag)
{
varval = 0;
port_str = cntrl.value;
if (port_str == "") {
if (flag == 1){
alert(errmsg1);
cntrl.select();
return false;
}}
val = toNumber(port_str, 0, port_str.length);
if (val < 0 || val > 65535)
{
alert(errmsg2);
cntrl.select();
return false;
}
else
{
return true;
}
}
function checkname(field,err_blank,err_space,err_invalid)
{
if (field.value.indexOf(" ") >=0)
{
alert(err_space);
field.focus();
field.select();
return false;
}
left_trim(field);
right_trim(field);
if (field.value =="" | field.value == null)
{
alert(err_blank);
field.focus();
field.select();
return false;
}
if (checkOtherChar(field.value, err_invalid)==false)
{
field.focus();
field.select();
return false;
}
if (isChinese(field.value)==true)
{
field.focus();
field.select();
return false;
}
return true;
}
function isChinese(inputStr){
iLength = inputStr.length
for


Ïà¹ØÎĵµ£º

¡¶Îò͸javascript¡·Ñ§Ï°±Ê¼Ç

¡¶Îò͸javascript¡·Ñ§Ï°±Ê¼Ç
 
Ò»¡¢          ǰÑÔ
http://blog.csdn.net/soldierluo/archive/2010/02/25/5326520.aspx
 
¶þ¡¢          »Ø¹é¼òµ¥¡¢»ù±¾ÀàÐÍ
http://blog.csdn.net/soldierluo/archive/2010/02 ......

JavascriptÖÐÀàµÄ¶¨ÒåºÍ¼Ì³Ð

ÀàµÄ¶¨ÒåÓÐ3ÖÖ»ù±¾·½·¨:
1¡¢´´½¨²¢ÄÜ·µ»ØÌض¨ÀàÐ͵ĶÔÏóµÄº¯Êý(¹¤³§º¯Êý)È磺
function wu()
{
  var w=new object;
  o.a=1;
  return o;
}ÓÃÕâÖÖ·½Ê½´´½¨¶ÔÏó£ºvar u=wu();
2¡¢´´½¨¹¹Ô캯Êý£¬ÓÃnewʵÀý»¯ÀýÈ磺
function wu()
{this.a=1;}
ÓÃÕâÖÖ·½Ê½´´½¨¶ÔÏó: var u=new wu();
3¡¢Ô­ÐÍ·½Ê½,À ......

JavaScriptº¯Êý±Õ°ü(closure) µÄÀí½â

×Ô´ÓѧϰJavaScriptÒÔÀ´£¬Ò»Ö±¶Ôº¯Êý±Õ°ü²»ÊÇÌ«Àí½â¡£ÖªµÀ´ó¸ÅÊÇʲô¸öÒâ˼£¬µ«ÊÇÒª½«Ò»¸ö²»»áµÄÈË½Ì»á»¹Õæ²»ÐС£×ÜÖ®¾ÍÊDz»Äܳ¹µ×µÄÀí½â¡£
½ñÌì¿´µ½µÄÕâÆªÎÄÕ¸оõ²»´í£¬ºÍ´ó¼Ò·ÖÏíһϡ£
http://www.felixwoo.com/archives/247 ......

JavascriptµÄ³£ÓÃÓï¾ä

1.document.write( " "); Êä³öÓï¾ä
2.JSÖеÄ×¢ÊÍΪ//
3.´«Í³µÄHTMLÎĵµË³ÐòÊÇ:document- >html- >(head,body)
4.Ò»¸öä¯ÀÀÆ÷´°¿ÚÖеÄDOM˳ÐòÊÇ:window- >(navigator,screen,history,location,document)
5.µÃµ½±íµ¥ÖÐÔªËØµÄÃû³ÆºÍÖµ:document.getElementById( "±íµ¥ÖÐÔªËØµÄID號 ").name(»òvalue)
6.Ò»¸ö ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ