【发布时间】:2016-07-31 16:37:40
【问题描述】:
function User()
{
this.username = null;
this.password = null;
this.first = null;
this.last = null;
}
var userList = new Array();
userList[0] = new User();
userList[1] = new User();
userList[2] = new User();
userList[0].username = "Georgie19";
userList[1].username = "PaulC-87";
uesrList[2].username = "JamesHat";
userList[0].password = "georgepass101";
userList[1].password = "adminpaul-13";
userList[2].password = "jamesH7";
userList[0].first = "George";
userList[1].first = "Paul";
userList[2].first = "James";
userList[0].last = "Hordin";
userList[1].last = "Corman";
userList[2].last = "Haquel";
document.write(userList[0].username);
当我将其放入浏览器时,它显示为空白。我已经尝试摆脱我不使用的东西,它会自动工作。我实在想不通。我怀疑这是我根本找不到的语法错误,请帮忙。 PS:这不是我的 HTML 的问题
【问题讨论】:
-
“我已经尝试摆脱我不使用的东西”,哪些东西?
-
uesrList真的是您在控制台中尝试过的吗? (第一个块分配给.username,uesrList[2].username = ...) -
此外,不确定您的应用程序到底是什么,但要知道,在 JavaScript 中以纯文本形式存储密码,就安全性而言,相当于告诉用户每个人的密码是什么。
-
仅供参考,没有必要重复所有这些:pastie.org/10792528 是的,@JCOC611 所说的。大时代。
标签: javascript html web