javaScriptÈ¥³ýÇ°¡¢ºó¡¢Öмä¿Õ¸ñ
=====ÄÜÈ¥Öмä==================================================
·½·¨Ò»£º£¨²»ÄÜÈ¥»»Ðеȣ©
´úÂë¼ò½àÓÐÁ¦¡£Ãî¾ÍÃîÔÚsplitº¯ÊýµÄʹÓÃÉÏ¡£ÏÈÓÿոñ·Ö¸î(split)×Ö·û´®£¬È»ºóÆ´½Ó.²»µÃ²»Åå·þÖ®£¬²Å˼Ãô½Ý°¡¡£¿´ÕâÑùµÄ´úÂ룬ÈÃÈËÉñÇåÆøˬ¡£
function IgnoreSpaces(Str){
var ResultStr = "";
Temp=Str.split(" ");//Ë«ÒýºÅÖ®¼äÊÇÒ»¸ö¿Õ¸ñ
for(i = 0; i < Temp.length; i++){
ResultStr +=Temp[i];
}
return ResultStr;
}
·½·¨¶þ£º
====ÒÔÏÂÊDz»È¥Öмä¿Õ¸ñµÄ======================================================
·½·¨Ò»£º
//javascriptÈ¥¿Õ¸ñº¯Êý
function LTrim(str){ //È¥µô×Ö·û´®µÄ Í·¿Õ¸ñ
var i;
for(i=0;i if(str.charAt(i)!=" "&&str.charAt(i)!=" ") break;
}
str = str.substring(i,str.length);
return str;
}
function RTrim(str){//È¥µô×Ö·û´®µÄ β¿Õ¸ñ
var i;
for(i=str.length-1;i>=0;i--){
if(str.charAt(i)!=" "&&str.charAt(i)!=" ") break;
}
str = str.substring(0,i+1);
return str;
}
function Trim(str){//È¥µô×Ö·û´®µÄ Ç°¡¢Î²¿Õ¸ñ£¨×¢ÒâÊǵ÷ÓÃÒÔÉÏÁ½¸ö·½·¨Ó´£©
return LTrim(RTrim(str));
}
·½·¨¶þ£º
¸öÈËÈÏΪ×îºÃµÄ·½·¨.²ÉÓõÄÊÇÕýÔò±í´ïʽ,ÕâÊÇ×îºËÐĵÄÔÀí.
Æä´Î.Õâ¸ö·½·¨Ê¹ÓÃÁËJavaScript µÄprototype ÊôÐÔ
ÆäʵÄ㲻ʹÓÃÕâ¸öÊôÐÔÒ»Ñù¿ÉÒÔÓú¯ÊýʵÏÖ.µ«ÕâÑù×öºóÓÃÆðÀ´±È½Ï·½±ã.
ÏÂÃæ¾ÍÀ´¿´¿´Õâ¸öÊôÐÔÊÇÔõôÀ´ÓõÄ.
·µ»Ø¶ÔÏóÀàÐÍÔÐ͵ÄÒýÓá£
objectName.prototype
objectName ²ÎÊýÊǶÔÏóµÄÃû³Æ¡£
˵Ã÷
Óà prototype ÊôÐÔÌṩ¶ÔÏóµÄÀàµÄÒ»×é»ù±¾¹¦ÄÜ¡£¶ÔÏóµÄÐÂʵÀý“¼Ì³Ð”¸³Óè¸Ã¶ÔÏóÔÐ͵IJÙ×÷¡£
ÀýÈ磬ҪΪ Array ¶ÔÏóÌí¼Ó·µ»ØÊý×éÖÐ×î´óÔªËØÖµµÄ·½·¨¡£ÒªÍê³ÉÕâÒ»µã£¬ÉùÃ÷¸Ãº¯Êý£¬½«Ëü¼ÓÈë Array.prototype£¬²¢Ê¹ÓÃËü¡£
function array_max( ){
var i, max = this[0];
for (i = 1; i < this.length; i++)
{
if (max < this[i])
max = this[i];
}
return max;
}
Array.prototype.max = array_max;
var x = new Array(1, 2, 3, 4, 5, 6);
var y = x.max( );
¸Ã´úÂëÖ´Ðкó£¬y ±£´æÊý×é x ÖеÄ×î´óÖµ£¬»ò˵ 6¡£
ËùÓÐ JScri
Ïà¹ØÎĵµ£º
Òý×Ó
±à³ÌÊÀ½çÀïÖ»´æÔÚÁ½ÖÖ»ù±¾ÔªËØ£¬Ò»¸öÊÇÊý¾Ý£¬Ò»¸öÊÇ´úÂë¡£±à³ÌÊÀ½ç¾ÍÊÇÔÚÊý¾ÝºÍ´úÂëǧ˿ÍòÂƵľÀ²øÖгÊÏÖ³öÎÞÏÞµÄÉú»úºÍ»îÁ¦¡£
Êý¾ÝÌìÉú¾ÍÊÇÎľ²µÄ£¬×ÜÏë±£³Ö×Ô¼º¹ÌÓеı¾É«£»¶ø´úÂëÈ´ÌìÉú»îÆã¬×ÜÏë¸Ä±äÕâ¸öÊÀ½ç¡£
Äã¿´£¬Êý¾Ý´úÂë¼äµÄ¹ØϵÓëÎïÖ ......
Ò»¡¢ ÔÚ×Ô¶¨ÒåcssÑùʽÖÐÊäÈë </style> ½«css´úÂë¶Î½áÊø£»
¶þ¡¢ ÔÚ </style> ºóÃæÊäÈë <script type="text/javascript" language="javascript">js´úÂë</script>£»
Èý¡¢ ±£´æÅäÖþͿÉÒÔÓÐÄãÊäÈëµÄjsÌØЧÀ²¡£
ÓÉÓÚ±¾È˶Ôjs²»ÊǺÜÊìϤ£¬ÕâÀï¾Í²»Ð´Àý×ÓÁË£¬Ï£Íû ......
ÀýÈ磺ÓÐÈý¸öÀàclassX,classY,classZ
classZ·Ö±ð¼Ì³ÐclassXºÍclassY
ÓÚÊǾÍÓÐÏÂÃæµÄд·¨£º
function ClassZ(){
this.newMethod=classX;
this.newMethod();
delete this.newMethod;
this.newMethod=classY;
this.newMethod();
delete this.newMethod;
}
ÕâÖÖд·¨´æÔÚÒ»¸ö±×¶Ë.¡£Èç¹ûclassXºÍclassYÓоßÓÐͬÃûµÄÊô ......
JavaScriptÌṩÁËÒ»¸öRegExp¶ÔÏóÀ´Íê³ÉÓйØÕýÔò±í´ïʽµÄ²Ù×÷ºÍ¹¦ÄÜ£¬Ã¿Ò»ÌõÕýÔò±í´ïʽģʽ¶ÔÓ¦Ò»¸öRegExpʵÀý¡£ÓÐÁ½ÖÖ·½Ê½¿ÉÒÔ´´½¨RegExp¶ÔÏóµÄʵÀý¡£
ʹÓÃRegExpµÄÏÔʽ¹¹Ô캯Êý£¬Ó﷨Ϊ£ºnew RegExp("pattern"[,"flags"])¡£
ʹÓÃRegExpµÄÒþʽ¹¹Ô캯Êý£¬²ÉÓô¿Îı¾¸ñʽ£º/pattern/[flags]¡£
pattern²¿·ÖΪҪʹÓõÄÕýÔò ......
¹ØÓÚJAVASCRIPT²éѯÊý¾Ý¿âµÄ´úÂë
´úÂëΪ£º
var conn = Server.CreateObject("ADODB.Connection");
conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("shjzd.mdb"); ......