JavascriptÊý×é¼°Æä²Ù×÷
JavascriptÊý×é¼°Æä²Ù×÷[ת]
2009-06-10 10:10
±¾ÎĽéÉÜÈçϼ¸¸ö·½ÃæµÄÄÚÈÝ:
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])
});
Ïà¹ØÎĵµ£º
ÔÚµÚÒ»ÕÂÖУ¬ÎÒÃÇʹÓù¹Ô캯ÊýºÍÔÐ͵ķ½Ê½ÔÚJavaScriptµÄÊÀ½çÖÐʵÏÖÁËÀàºÍ¼Ì³Ð£¬ µ«ÊÇ´æÔںܶàÎÊÌâ¡£ÕâÒ»ÕÂÎÒÃǽ«»áÖðÒ»·ÖÎöÕâЩÎÊÌ⣬²¢¸ø³ö½â¾ö·½°¸¡£
×¢£º±¾ÕÂÖеÄjClassµÄʵÏֲο¼ÁËSimple JavaScript Inheritance
µÄ×ö·¨¡£
Ê×ÏÈÈÃÎÒÃÇÀ´»Ø¹ËһϵÚÒ»ÕÂÖнéÉܵÄÀý×Ó£º
function Person(name) {
this.name = nam ......
JavaScript¿ÉÒÔÔÚ¿Í»§¶ËʵÏֺܶàÓÐÓõĽ»»¥¶¯×÷¡£Í¨¹ýµ÷ÓÃActive×é¼þ£¬»¹ÄܽøÒ»²½ÌáÉý²Ù×÷ÄÜÁ¦¡£ÔÚ¿Í»§¶ËдÎļþÒ»°ãʹÓÃFSO×é¼þ¡£µ«FSOÓиöÈõµã£¬¾ÍÊÇËü²»ÄÜд³ö¶þ½øÖƵÄÎļþ£¬Õâ¿ÉÄÜÊdzöÓÚ°²È«µÄ¿¼ÂÇ°É¡£
Èç¹ûҪд³ö¶þ½øÖÆÎļþ£¬±ÈÈç´Ó·þÎñÆ÷´«À´µÄWordÎĵµ£¬¿ÉÒÔ²ÉÓÃÁíÒ»¸ö×é¼þ£ºAdodb.Stream¡ ......
JavascriptË¢ÐÂÒ³ÃæµÄ¼¸ÖÖ·½·¨£º
³ÌÐò´úÂë
1 history.go(0)
2 location.reload()
3 location=location
4 location.assign(location)
5 document.execCommand('Refres ......
±¾ÎĽéÉÜÈçϼ¸¸ö·½ÃæµÄÄÚÈÝ:
1.ÈçºÎ´´½¨Êý×é
2.ÈçºÎ¶ÔÊý×é½øÐвÙ×÷£¨Ìí¼Ó,ɾ³ý,¶ÁÈ¡)
3.Êý×é³£¼û·½·¨ºÍÊôÐÔ
ÈçºÎ´´½¨Ò»¸öÊý×é,Ò»°ãµØ¸ù¾Ý³õʼ»¯É趨¼òµ¥·ÖΪ3ÖÖ:
1.µ¥´¿´´½¨Êý×é:
var arr=new Array();
Òªµã:ÓÃnew¹Ø¼ü×Ö´´½¨Êý×é¶ÔÏóArray(),Array()¶ÔÏóÊÇÒ»¸ö±¾µØÀà,¿ÉÒÔÓÃnew´´½¨Ò»¸ö¶ÔÏóºóʹÓÃ
2.´´½¨Êý×éµÄÍ ......
0.Á´½ÓcssÎļþºÍjsÎļþ
<link rel="stylesheet" href="../css/style.css" mce_href="css/style.css" type="text/css">
<mce:script language="javascript" src="../includes/jslib.js" mce_src="includes/jslib.js" ></mce:script>
1.¹Ø±ÕÊäÈë·¨
<input style="ime-mode ......