function getuser() {
var username = document.getElementById("username").value;
var password = document.getElementById("password").value;
testing(username, password)
}
function testing(username, password) {
var tmp = username && password;
if (tmp == "") {
alert("请填写完整信息");
}else{
window.location.href = "comment.html";
alert("登录成功");
localStorage.setItem("username",username);
}
}
原生的JavaScript不行吗?
如果真的转化话,这样?没有啥意义呀,具体可以看文档