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

JavaScriptÖÐʹÓÃÔ­ÐÍÀ´´´½¨¶ÔÏó

ÔÚ±àд¹¹Ô캯Êýʱ£¬¿ÉÒÔʹÓÃÔ­ÐͶÔÏó£¨Ëü±¾ÉíÊÇËùÓй¹Ô캯ÊýµÄÒ»¸öÊôÐÔ£©µÄÊôÐÔÀ´´´½¨¼Ì³ÐÊôÐԺ͹²Ïí·½·¨¡£Ô­ÐÍÊôÐԺͷ½·¨½«°´ÒýÓø´ÖƸøÀàÖеÄÿ¸ö¶ÔÏó£¬Òò´ËËüÃǶ¼¾ßÓÐÏàͬµÄÖµ¡£¿ÉÒÔÔÚÒ»¸ö¶ÔÏóÖиü¸ÄÔ­ÐÍÊôÐÔµÄÖµ£¬ÐµÄÖµ½«¸²¸ÇĬÈÏÖµ£¬µ«½öÔÚ¸ÃʵÀýÖÐÓÐЧ¡£ÊôÓÚÕâ¸öÀàµÄÆäËû¶ÔÏó²»Êܴ˸ü¸ÄµÄÓ°Ïì¡£ÏÂÃæ¸ø³öÁËʹÓÃ×Ô¶¨Òå¹¹Ô캯ÊýµÄʾÀý£¬Circle£¨×¢Òâ this ¹Ø¼ü×ÖµÄʹÓã©¡£
 
Circle.prototype.pi = Math.PI;
function ACirclesArea () {
    return this.pi * this.r * this.r; // ¼ÆËãÔ²Ãæ»ýµÄ¹«Ê½Îª ?r2¡£
}
Circle.prototype.area = ACirclesArea; // ¼ÆËãÔ²Ãæ»ýµÄº¯ÊýÏÖÔÚÊÇ Circle Prototype ¶ÔÏóµÄÒ»¸ö·½·¨¡£
var a = ACircle.area();               // ´ËΪÈçºÎÔÚ Circle ¶ÔÏóÉϵ÷ÓÃÃæ»ýº¯Êý¡£
ʹÓÃÕâ¸öÔ­Ôò£¬¿ÉÒÔ¸øÔ¤¶¨ÒåµÄ¹¹Ô캯Êý£¨¶¼¾ßÓÐÔ­ÐͶÔÏ󣩶¨Ò帽¼ÓÊôÐÔ¡£ÀýÈ磬Èç¹ûÏëÒªÄܹ»É¾³ý×Ö·û´®µÄÇ°ºó¿Õ¸ñ£¨Óë VBScript µÄ Trim º¯ÊýÀàËÆ£©£¬¾Í¿ÉÒÔ¸ø String Ô­ÐͶÔÏó´´½¨×Ô¼ºµÄ·½·¨¡£
 
// Ôö¼ÓÒ»¸öÃûΪ trim µÄº¯Êý×÷Ϊ
// String ¹¹Ô캯ÊýµÄÔ­ÐͶÔÏóµÄÒ»¸ö·½·¨¡£
String.prototype.trim = function()
{
    // ÓÃÕýÔò±í´ïʽ½«Ç°ºó¿Õ¸ñ
    // ÓÿÕ×Ö·û´®Ìæ´ú¡£
    return this.replace(/(^\s*)|(\s*$)/g, "");
}
 
// ÓпոñµÄ×Ö·û´®
var s = "    leading and trailing spaces    ";
 
// ÏÔʾ "    leading and trailing spaces     (35)"
window.alert(s + " (" + s.length + ")");
 
// ɾ³ýÇ°ºó¿Õ¸ñ
s = s.trim();
// ÏÔʾ"leading and trailing spaces (27)"
window.alert(s + " (" + s.length + ")");
 
 


Ïà¹ØÎĵµ£º

javaScript document¶ÔÏóÏê½â

 Document¶ÔÏóÄÚÈݼ¯ºÏ
document Îĵ²¶ÔÏó - JavaScript½Å±¾ÓïÑÔÃèÊö
———————————————————————
×¢:Ò³ÃæÉÏÔªËØnameÊôÐÔºÍJavaScriptÒýÓõÄÃû³Æ±ØÐëÒ»Ö°üÀ¨´óСд
·ñ ......

firefoxÓëIE¼æÈÝjavascriptºÍCSS


css:
1.   
ul±êÇ©ÖÐFFÖÐÓиöpaddingÖµ£¬È´Ã»ÓÐmarginÖµ£¬¶øÔÚIEÖÐÕýºÃÏà·´   
½â¾ö°ì·¨:½«ulµÄpaddingºÍmargin¶¼ÉèΪ0(Ò²¿ÉÒÔ²»ÊÇ0)È磺padding:0;margin:0;list-style:none;   
ÁíÍâformĬÈÏÔÚIEÖÐÒ²»áÓÐmarginÖµ£¬ËùÒÔ×îºÃÒ²½«ÆämarginºÍpaddingÉèΪ0   
2.    ......

JavaScriptÈÕÆÚУÑé

 //ÓÉÒ³ÃæÔªËØdate_string(YYYY-MM_DD¸ñʽ)µÃµ½Êý×édate_array
 //ÊäÈë²ÎÊý£ºdate_string:ÈÕÆÚ´®£»marker:ÈÕÆÚ´®date_stringÀïµÄ·Ö¸ô·û£¬Èç¹ûûÓÐÔòΪ""£»
 //·µ»ØÖµ£º Êý×飺date_array
 //            Êý×éÔªËØdate_array.year=YYYY£»dat ......

JavaScript×Ö·û´®º¯Êý´óÈ«

http://blog.csdn.net/cyai/archive/2009/05/25/4213956.aspx 
JS×Ô´øº¯Êý
concat
½«Á½¸ö»ò¶à¸ö×Ö·ûµÄÎı¾×éºÏÆðÀ´£¬·µ»ØÒ»¸öеÄ×Ö·û´®¡£
var a = "hello";
var b = ",world";
var c = a.concat(b);
alert(c);
//c = "hello,world"
indexOf
·µ»Ø×Ö·û´®ÖÐÒ»¸ö×Ó´®µÚÒ»´¦³öÏÖµÄË÷Òý£¨´Ó×óµ½ÓÒËÑË÷£©¡£Èç¹ûÃ»Ó ......

javascript ʼþÁбí½â˵

 



javascript
ʼþÁбí½â˵
ʼþ
ä¯ÀÀÆ÷Ö§³Ö
½â˵
Ò»°ãʼþ
onclick
IE3¡¢N2
Êó±êµã»÷ʱ´¥·¢´Ëʼþ
ondblclick
IE4¡¢N4
Êó±êË«»÷ʱ´¥·¢´Ëʼþ
onmousedown
IE4¡¢N4
°´ÏÂÊó±êʱ´¥·¢´Ëʼþ
onmouseup
IE4¡¢N4
Êó±ê°´ÏºóËÉ¿ªÊó±êʱ´¥·¢´Ëʼþ
onmouseover
IE3¡¢N2
µ±Êó±êÒƶ¯µ½Ä³¶ÔÏ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ