下雨不停的雨婷
2016-07-15 10:37
为什么在浏览器里不显示结果?
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>二维数组</title>
<script type="text/javascript">
var myarr=new Array();
for(var i=0;i<3;i++){
myarr[i]=new Array();
for(var j=0;j<6;j++){
myarr[i][j]=i*j;
}
}
document.write(myarr[i][j]);
</script>
</head>
<body>
</body>
</html>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>二维数组</title>
<script type="text/javascript">
var myarr=new Array();
for(var i=0;i<3;i++){
myarr[i]=new Array();
for(var j=0;j<6;j++){
myarr[i][j]=i*j;
document.write(myarr[i][j]);
}
}
</script>
</head>
<body>
</body>
</html>
document.write(myarr[i][j]);放在 myarr[i][j]=i*j;下面
document.write(myarr[i][j]);放在document.write(myarr[i][j]);下面
JavaScript进阶篇
468191 学习 · 21891 问题
相似问题