我需要帮助将数组从一页转移到另一页。以下是我使用名称列表创建的代码。在另一个页面中,我想要这个数组并将它们打印出来。我想知道我是否可以通过 javascript 获取这个数组。太感谢了!我已经分隔了两段代码,以便您可以轻松阅读它们。非常感谢!
<html>
<head>
<title>ys</title>
</head>
<body>
<script type="text/javascript">
var aName = new Array;
aName[0] = "daniel";
aName[1] = "zhang";
aName[2] = "alex";
aName[3] = "yang";
aName[4] = "Amy";
aName[5] = "Wang";
aName[6] = "Vincent";
aName[7] = "Lee";
for (i=0; i<8; i++)
{
document.write(aName[i] + "<br>")
}
</script>
</body>
</html>
<html>
<head>
<title>get the array from s.html and print out</title>
</head>
<body>
<script type="text/javascript">
for (i=0; i<8; i++)
{
document.write(aName[i] + "<br>")
}
</script>
</body>
</html>