ÔÚJavaScriptÖÐûÓжàάÊý×éµÄ¸ÅÄî
µ«ÊÇ¿ÉÒÔÄ£ÄâʵÏÖ
1ά
//1 ²»ÄÜÈ·¶¨Êý×élengthµÄÇé¿öÏ£¬ÏÈÉùÃ÷Ò»¸öÊý×éÃû£¬È»ºóÔÙÖð¸ö¸³Öµ¡£
var tArray=new Array();
tArray[0]='A';
tArray[1]='2';
//2 ÖªµÀÈ·ÇеÄlength£¬´´½¨Êý×é
var tArray=new Array(10);
//3 ´´½¨Êý×éµÄͬʱ²¢¸³Öµ
var tArray=new Array('A','2','3','4','5','6','7','8','9','10','J','Q','K');
var tArray=['A','2','3','4','5','6','7','8','9','10','J','Q','K'];
// ÒÔϵĶàάÊý×éÒ²ÀàËÆ
2ά
·½·¨1
var tArrar=new Array();
tArrar[0]=new Array();
tArrar[0][0]="aa";
tArrar[0][1]="bb";
tArrar[1]=new Array();
tArrar[1][0]="cc";
tArrar[1][1]="dd";
·½·¨2
var aa=new Array(['1','2'],['3','4'],['5','6'])£»
·½·¨3
javaStriptÉùÃ÷¶þάÊý×é:
var images=new Array(); //ÏÈÉùÃ÷һά
for(var i=0;i<10;i++){ //һά³¤¶ÈΪ10
images[i]=new Array(); //ÔÚÉùÃ÷¶þά
for(var j=0;j<20;j++){ //¶þά³¤¶ÈΪ20
images[i][j]=1;
}
}
3ά
·½·¨1
var tArray=new Array();
tArray[0]=new Array();
tArray[0][0]=new Array();
tArray[0][1]=new Array();
tArray[0][0][0]="111";
tArray[0][0][1]="222";
tArray[0][1][0]="333";
tArray[0][1][1]="444";
·½·¨2
var aa=new Array( [ ['000','001','002'], ['010','011','012'], ['020','021','022'] ], [ ['100','101','102'], ['110','111','112'], ['120','121','122'] ]);
ҪעÒâ £¨£©´óÀ¨ºÅÖÐ[]µÄ ǶÌ×λÖá£ÎªÁË¿´µÄ¸üÇåÎúЩ¡£ÐÞ¸ÄÁËһϸñʽ
var bb=new Array(
[
['000','001','002'],
['010','0
Á÷ÐÐµÄ JavaScript ¿â²»Ê¤Ã¶¾Ù£¬jQuery, MooTools, Prototype, Dojo, YUI¡£ÕâЩ JavaScript ¿â¹¦Äܷḻ£¬¼ÓÉÏËüÃǵIJå¼þ£¬¼¸ºõÄÜʤÈÎÈκι¤×÷£¬È»¶øÕâÊÇÓдú¼ÛµÄ£¬ÕâЩ¿âÍùÍùµ¼ÖÂÄãµÄÍøÒ³³ß´çÓ·Öס£ÔÚijЩ³¡ºÏ£¬Èç¹ûÄãÖ»ÏëÍê³ÉÌض¨µÄ¹¤×÷£¬¿ÉÒÔʹÓà һЩ¹¦ÄܸüרһµÄÇáÁ¿¿â£¬±¾ÎĽéÉÜÁË40¸ö·Ç³£³öÉ«µÄÇáÁ¿¼¶ JavaScript ¿â¡ ......
1. oncontextmenu="window.event.returnValue=false" ½«³¹µ×ÆÁ±ÎÊó±êÓÒ¼ü
<table border oncontextmenu=return(false)><td>no</table> ¿ÉÓÃÓÚTable
2. <body onselectstart="return false"> È¡ÏûÑ¡È¡¡¢·ÀÖ¹¸´ÖÆ
3. onpaste="return false" ²»×¼Õ³Ìù
4. oncopy="return false;" oncut="return f ......