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

JavascriptÊý×é¼°Æä²Ù×÷


±¾ÎĽéÉÜÈçϼ¸¸ö·½ÃæµÄÄÚÈÝ:
1.ÈçºÎ´´½¨Êý×é
2.ÈçºÎ¶ÔÊý×é½øÐвÙ×÷£¨Ìí¼Ó,ɾ³ý,¶ÁÈ¡)
3.Êý×é³£¼û·½·¨ºÍÊôÐÔ
ÈçºÎ´´½¨Ò»¸öÊý×é,Ò»°ãµØ¸ù¾Ý³õʼ»¯É趨¼òµ¥·ÖΪ3ÖÖ:
1.µ¥´¿´´½¨Êý×é:
var arr=new Array();
Òªµã:ÓÃnew¹Ø¼ü×Ö´´½¨Êý×é¶ÔÏóArray(),Array()¶ÔÏóÊÇÒ»¸ö±¾µØÀà,¿ÉÒÔÓÃnew´´½¨Ò»¸ö¶ÔÏóºóʹÓÃ
2.´´½¨Êý×éµÄͬʱ¹æ¶¨Êý×é´óС:
var arr=new Array(10);//ÕâÀï¾Í´´½¨ÁËÒ»¸ö³õʼ»¯´óСΪ10µÄÊý×é
×¢Òâ:µ±Ê¹ÓÃÊý×é´óС²Ù×÷³õʼ»¯´óСʱ,Êý×é»á×Ô¶¯±»³Å´ó,²»»áÏñCÓïÑÔÄÇÑù·¢Éú´íÎó.¶¯Ì¬Ôö³¤ÊÇjsÊý×éµÄÒ»¸öÐÔÖÊ.ÁíÍâ,jsÖÐÖ§³Ö×î´óÊý×鳤¶ÈΪ
4294967295
3.Ö±½Ó³õʼ»¯:
var arr=new Array("love","hate","pain");//ÕâÀï¾ÍÖ±½Ó³õʼ»¯ÁËÊý×é
»òvar arr=["happy","cute","scare"];//À¨ºÅÒ²¿ÉÒÔÉùÃ÷Ò»¸öÊý×é¶ÔÏó
µ±È»,ÀàËÆCÓïÑÔ,¿ÉÒÔ¶¨Òå2ά3άºÍ¶àάµÄÊý×é,ÀýÈç:
<script language="javascript">
    var myArray = new Array();
    for(var i=0;i<10;i++ )...{
        myArray[i]=new Array();
        myArray[i][0]=Math.floor(Math.random()*10);
        myArray[i][1]=Math.floor(Math.random()*10);
        myArray[i][2]=Math.floor(Math.random()*10);
        myArray[i][3]=Math.floor(Math.random()*10);
        myArray[i][4]=Math.floor(Math.random()*10);
        myArray[i][5]=Math.floor(Math.random()*10);
        myArray[i][6]=Math.floor(Math.random()*10);
        myArray[i][7]=Math.floor(Math.random()*10);
        myArray[i][8]=Math.floor(Math.random()*10);
    }
   
    myArray.sort( function(x, y) ...{
        return (x[0]==y[0])?((x[4]==y[4])?(x[8]-y[8]):(x[4]-y[4])):(x[2]-y[2])
    });
    for(var i=0;i<myArray.length


Ïà¹ØÎĵµ£º

JavaScript ¼Ì³ÐÏê½â1

 
¼¸ºõÿ¸ö¿ª·¢ÈËÔ±¶¼ÓÐÃæÏò¶ÔÏóÓïÑÔ£¨±ÈÈçC++¡¢C#¡¢Java£©µÄ¿ª·¢¾­Ñé¡£ ÔÚ´«Í³ÃæÏò¶ÔÏóµÄÓïÑÔÖУ¬ÓÐÁ½¸ö·Ç³£ÖØÒªµÄ¸ÅÄî - ÀàºÍʵÀý¡£
ÀඨÒåÁËÒ»ÀàÊÂÎ﹫¹²µÄÐÐΪºÍ·½·¨£»¶øʵÀýÔòÊÇÀàµÄÒ»¸ö¾ßÌåʵÏÖ¡£ ÎÒÃÇ»¹ÖªµÀ£¬ÃæÏò¶ÔÏó±à³ÌÓÐÈý¸öÖØÒªµÄ¸ÅÄî - ·â×°¡¢¼Ì³ÐºÍ¶à̬¡£
µ«ÊÇÔÚJavaScriptµÄÊÀ½çÖУ¬ËùÓеÄÕâÒ»ÇÐÌØ ......

JavaScript ¼Ì³ÐÏê½â3

ÔÚµÚÒ»ÕÂÖУ¬ÎÒÃÇʹÓù¹Ô캯ÊýºÍÔ­Ð͵ķ½Ê½ÔÚJavaScriptµÄÊÀ½çÖÐʵÏÖÁËÀàºÍ¼Ì³Ð£¬ µ«ÊÇ´æÔںܶàÎÊÌâ¡£ÕâÒ»ÕÂÎÒÃǽ«»áÖðÒ»·ÖÎöÕâЩÎÊÌ⣬²¢¸ø³ö½â¾ö·½°¸¡£
×¢£º±¾ÕÂÖеÄjClassµÄʵÏֲο¼ÁËSimple JavaScript Inheritance
µÄ×ö·¨¡£
Ê×ÏÈÈÃÎÒÃÇÀ´»Ø¹ËһϵÚÒ»ÕÂÖнéÉܵÄÀý×Ó£º
function Person(name) {
this.name = nam ......

javascript trim

×î½ü×öË°Îñ×ÛºÏƽ̨¹¤×÷Á÷£¬ ÔÚÒ³ÃæÉÏÅжÏÊÇ·ñÊÇ“»õ±Ò½ð¶î”¸ñʽ£¬Ê¹ÓõÄÊÇÕýÔò±í´ïʽ£¬Ò»Ö±¶¼Ã»ÓÐÎÊÌ⣬
ºóÀ´Í»È»ÎÞ·¨ÑéÖ¤£¬ ¾ÍÊDz»·ûºÏÕýÔò±í´ïʽµÄ½á¹¹£¬×îºóÖÕÓÚ·¢ÏÖ ½ð¶îºóÃæ°üº¬¿Õ¸ñ×Ö·û´®£¬ÔÚÍøÉÏÕÒµ½Ò»¶Î´úÂë £¬ÕýºÃ½â¾ö¡£
String.prototype.trim= function(){
   // ÓÃÕýÔò±í´ïʽ½«Ç°ºó¿ ......

javascriptʼþÁбí


javascriptʼþÁбí½â˵
ʼþ
ä¯ÀÀÆ÷Ö§³Ö
½â˵
Ò»°ãʼþ
onclick
IE3¡¢N2
Êó±êµã»÷ʱ´¥·¢´Ëʼþ
ondblclick
IE4¡¢N4
Êó±êË«»÷ʱ´¥·¢´Ëʼþ
onmousedown
IE4¡¢N4
°´ÏÂÊó±êʱ´¥·¢´Ëʼþ
onmouseup
IE4¡¢N4
Êó±ê°´ÏºóËÉ¿ªÊó±êʱ´¥·¢´Ëʼþ
onmouseover
IE3¡¢N2
µ±Êó±êÒƶ¯µ½Ä³¶ÔÏó·¶Î§µÄÉÏ·½Ê±´¥·¢´Ëʼ ......

JavaScript ÕýÔò±í´ïʽ

½ñÌìÔÚ²©¿ÍÔ°ÉÏ¿´µ½Ò»ÆªÎÄÕ£¬¸ú×ÅѧϰÁËһϣ¬×ª¹ýÀ´Óë´ó¼Ò·ÖÏí£¬²¿·ÖÄÚÈÝÎÒ×öÁ˲¹³ä£¡ 
Ò»¡¢JavaScriptÕýÔò±í´ïʽ»ù±¾ÖªÊ¶ 
1¡¢JavaScriptÕýÔò±í´ïʽ´´½¨ºÍÓ÷¨ 
    ÉùÃ÷ÕýÔò±í´ïʽÓÐÁ½ÖÖ·½Ê½£º
a) var reCat = new RegExp("cat");
b) var reCat = /cat/;  //perl·ç¸ñ£¨ÍƼö£©& ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ