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
Ïà¹ØÎĵµ£º
1£¬ jsÖеÄÀàÊý×é¶ÔÏó
(1) arguments¶ÔÏó:
function(){
//arguments¶ÔÏóÊÇArguments¶ÔÏóʵÀý£¬ÊÇÒ»¸öÀàÊý×é¶ÔÏ󣬲¢ÓµÓÐÏÂÁз½·¨
alert(arguments instanceof Array);//false
arguments.callee(); //¶Ô×ÔÉíµÄµ÷Ó㬠ÓÃÓڵݹé
var c = arguments.caller; //¶Ôµ÷ÓÃ×ÔÉíº¯ÊýµÄ¸¸º¯Êý, Èç¹û ......
JavaScript¿ÉÒÔÔÚ¿Í»§¶ËʵÏֺܶàÓÐÓõĽ»»¥¶¯×÷¡£Í¨¹ýµ÷ÓÃActive×é¼þ£¬»¹ÄܽøÒ»²½ÌáÉý²Ù×÷ÄÜÁ¦¡£ÔÚ¿Í»§¶ËдÎļþÒ»°ãʹÓÃFSO×é¼þ¡£µ«FSOÓиöÈõµã£¬¾ÍÊÇËü²»ÄÜд³ö¶þ½øÖƵÄÎļþ£¬Õâ¿ÉÄÜÊdzöÓÚ°²È«µÄ¿¼ÂÇ°É¡£
Èç¹ûҪд³ö¶þ½øÖÆÎļþ£¬±ÈÈç´Ó·þÎñÆ÷´«À´µÄWordÎĵµ£¬¿ÉÒÔ²ÉÓÃÁíÒ»¸ö×é¼þ£ºAdodb.Stream¡ ......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> new document </title>
<meta name="generator" content="edit ......
±íµ¥µÄÓÐЧÐÔ¼ìÑéÊÇjavascriptÒ»¸öºÜÓÐÓõķ½Ãæ¡£Ëü¿ÉÒÔÓÃÓÚ¼ì²éÒ»¸ö¸ø¶¨µÄ±íµ¥ÒÔ¼°·¢ÏÖ±íµ¥ÖеÄÈκÎÎÊÌ⣬±ÈÈçÒ»¸ö¿Õ°×µÄÊäÈë¿ò»òÕßÒ»¸öÎÞЧµÄE-mail£¨µç×ÓÓʼþ£©µØÖ·£¬È»ºóËü¿ÉÒÔ֪ͨÓû§²¢ÇҾͲ»»á½«ÕâЩ´íÎóµÄ±íµ¥´«¸ø·þÎñÆ÷ÒÔ½Úʡʱ¼ä¡£ÁíÍ⣬³ý´ËÒÔÍ⣬¶Ô±íµ¥±êÇ©µÄһЩÐ޸ĸúÆäËüÀàÐ͵Ľű¾ÊÇÀàËƵġ£ÒÔϵÄÀý×ÓÊÇÒ» ......
ÒÔ´´½¨°´Å¥ÎªÀý
<html>
<head>
<script>
function add1()
{
var obtn=document.createElement("input");
obtn.setAttribute("type","button");
obtn.setAttribute("value","test1");
document.body.appendChild(obtn);//×¢ÒâÈç¹ûÓÐf ......