|
|
|
จะสร้าง array2D มิติ ใน javascript โดยมี key ยังไงหรอครับ |
|
|
|
|
|
|
|
ไม่ต้องประกาศครับ กำหนดค่าตัวแปรได้เลยครับ
|
|
|
|
|
Date :
2011-08-24 17:02:13 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (JavaScript)
<HTML>
<HEAD>
<TITLE>Arrays within Arrays</TITLE>
</HEAD>
<BODY>
<H1 ALIGN="CENTER">Arrays within Arrays</H1>
<SCRIPT LANGUAGE="JavaScript"><!--
junk = new Array("s1",'s2',4,3.5,true,false,null,new Array(5,6,7));
document.write("junk[0] = "+junk[0]+"<BR>");
document.write("junk[1] = "+junk[1]+"<BR>");
document.write("junk[2] = "+junk[2]+"<BR>");
document.write("junk[3] = "+junk[3]+"<BR>");
document.write("junk[4] = "+junk[4]+"<BR>");
document.write("junk[5] = "+junk[5]+"<BR>");
document.write("junk[6] = "+junk[6]+"<BR>");
document.write("junk[7][0] = "+junk[7][0]+"<BR>");
document.write("junk[7][1] = "+junk[7][1]+"<BR>");
document.write("junk[7][2] = "+junk[7][2]);
// -->
</SCRIPT>
</BODY>
</HTML>
|
|
|
|
|
Date :
2011-08-24 17:02:44 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script>
var obj = {};
obj['abc'] = [];
obj['abc'][0] = 1;
obj['abc'][1] = 2;
alert(obj['abc'][0]);
</script>
|
|
|
|
|
Date :
2011-09-09 22:18:02 |
By :
num |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|