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

JavaScript prototypeµÄÌå»á


    ÔÚJavaScriptÖÐÔ­Ð;ÍÏ൱ÓÚjavaÖеÄÀඨÒ壬ÿ¸öJavaScriptʵÀý¶ÔÏó¶¼»á°üº¬Ô­ÐÍÖж¨ÒåµÄÊôÐÔÓë·½·¨¡£
   ÔÚ±àд¹¹Ô캯Êýʱ£¬¿ÉÒÔʹÓÃÔ­ÐͶÔÏó£¨Ëü±¾ÉíÊÇËùÓй¹Ô캯ÊýµÄÒ»¸öÊôÐÔ£©µÄÊôÐÔÀ´´´½¨¼Ì³ÐÊôÐԺ͹²Ïí·½·¨¡£
Ô­ÐÍÊôÐԺͷ½·¨½«°´ÒýÓø´ÖƸøÀàÖеÄÿ¸ö¶ÔÏó£¬Òò´ËËüÃǶ¼¾ßÓÐÏàͬµÄÖµ¡£
¿ÉÒÔÔÚÒ»¸ö¶ÔÏóÖиü¸ÄÔ­ÐÍÊôÐÔµÄÖµ£¬ÐµÄÖµ½«¸²¸ÇĬÈÏÖµ£¬µ«½öÔÚ¸ÃʵÀýÖÐÓÐЧ¡£ÊôÓÚÕâ¸öÀàµÄÆäËû¶ÔÏó²»Êܴ˸ü¸ÄµÄÓ°Ïì¡£
 ÀýÈ磺
// Ôö¼ÓÒ»¸öÃûΪ trim µÄº¯Êý×÷Ϊ
// String ¹¹Ô캯ÊýµÄÔ­ÐͶÔÏóµÄÒ»¸ö·½·¨¡£
String.prototype.trim = function()
{
    // ÓÃÕýÔò±í´ïʽ½«Ç°ºó¿Õ¸ñ
    // ÓÿÕ×Ö·û´®Ìæ´ú¡£
    return this.replace(/(^\s*)|(\s*$)/g, "");
}


Ïà¹ØÎĵµ£º

Flexͨ¹ýjavascript¶Áдcookie

×î½üÓöµ½¸öÎÊÌ⣬¿ª·¢webÏîÄ¿µÄʱºò£¬¿ÉÄÜflexÖ»ÓÃÀ´ÊµÏÖÏîÄ¿µÄ²¿·ÖÄ£¿é¡£µ±flexÐèÒªÔÚ¿Í»§¶ËдÈë/¶ÁȡһЩ״̬ÐÅÏ¢µÄʱºò£¬ÎÒÃÇ»áÏëµ½ÓÃcookie¡£flexÊDz»Ö§³ÖcookieµÄ£¬Ö»ÓÐSharedObjectÕâ¸ö±¾µØ¶ÔÏó¡£ËùÒÔ½â¾öµÄ°ì·¨¾ÍÓÐÁ½¸ö£º
flexͨ¹ýµ÷ÓÃjsÀ´ÊµÏÖ¶ÔcookieµÄ²Ù×÷£»
jsͨ¹ýflexʵÏÖ¶ÔSharedObjectµÄ²Ù×÷£»
ÕâÁ½ÖÖ·½·¨ ......

ÍøÒ³ÆÁ±Î¼üÅ̰´¼üjavascript½Å±¾


function keyDown(){
  //ÆÁ±ÎÊó±êÓÒ¼ü¡¢Ctrl+n¡¢shift+F10¡¢F5ˢС¢Í˸ñ¼ü
   //alert("ASCII´úÂëÊÇ£º"+event.keyCode);
   if ((window.event.altKey)&&
    ((window.event.keyCode==37)||   //ÆÁ±Î Alt+ ·½Ïò¼ü ←
     (w ......

Ïêϸ½â¶ÁJavaScriptµÄthis¹Ø¼ü×Ö


ÓÃÁ˺ܾÃJavaScript£¬¶Ô¡¾this¡¿µÄÈÏʶֻ¾ÖÏÞÓÚÒÔÍùµÄƾ¾­Ñé¶øÒÑ£¬²»¹ý½ñÌì·¢ÏÖÁ˺ö«Î÷“http://www.quirksmode.org/js/associative.html”£¬ÏêϸÃèÊöÁËÈçºÎʹÓá¾this¡¿¹Ø¼ü×Ö£¬ÔÚÕâÀïÎҾͼò¶ÌµÄ˵һÏÂÖØµã£¬Èç¹ûÓÐÒÉÎÊ¿ÉÒÔÖ±½Ó²Î¿¼Ô­ÎÄ¡£
ÔÚѧϰ¹ýÓÐthisµÄ±à³ÌÓïÑÔÖУ¬thisÒ»°ã¶¼ÊÇÖ¸Ïòµ±Ç°ÊµÀý¶ÔÏóµÄ£¬¶ÔÓ ......

ʵÓÃµÄ JavaScript ²âÊÔ¼°Ð§Ñ鹤¾ß


ת×Ôwww.cnbeta.com/articles/108735.htm
JavaScript ÊÇÒ»¿îÇ¿´óµÄ¹ã·ºÔËÓÃÓÚÏÖ´úWebÕ¾µã¼°Ó¦ÓõĽű¾ÓïÑÔ¡£×÷Ϊһ¸ö¼¼ÒÕ¾«Õ¿µÄ Web ¿ª·¢Õߣ¬ÕÆÎÕJavaScript¿ÉÒÔÔöÇ¿Óû§µÄʹÓÃÌåÑ飬Ìṩ½»»¥¼°¸»¿Í»§¶ËµÈ¹¦ÄÜ¡£
¾¡¹ÜJavaScript µÄÓï·¨·Ç³£¼òµ¥£¬µ«¶ÔÓÚд³ÌÐò¶øÑÔÈÔÈ»ÊÇÀ§ÄÑÖØÖØ£¬¾ÍÊÇÒòΪËüµÄÔËÐл·¾³£º»ùÓÚ ......

javascript µÄperlÀàÐ͵ÄÕýÔò±í´ïʽ

£¨1£©var recat = new RegExp("cat");    //¼òµ¥¶¨Òå¡£
        var recat = new RegExp("cat","gi");//g->global,i->case insensitive.
        var recat = /cat/gi;                       ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ