function pass()
{
var pw, Eingabe;
pw=window.document.alinkColor;
Eingabe=prompt ("Please enter password");
if (Eingabe==pw)
{
window.location.href=String.fromCharCode(97,98,114,97,101)+".htm";
}
else
{
alert("Try again");
}
}
Nhờ dịch đoạn code
{
var pw, Eingabe;
pw=window.document.alinkColor;
Eingabe=prompt ("Please enter password");
if (Eingabe==pw)
{
window.location.href=String.fromCharCode(97,98,114,97,101)+".htm";
}
else
{
alert("Try again");
}
}
Bạn nên sửa theo kiểu này để code dễ đọc hơn.
1 Like
đây là JavaScript hả bạn ?
function pass() {
var pw, Eingabe;
pw = window.document.alinkColor; // pass là giá trị của thuộc tính alink trên thẻ body
Eingabe = prompt("Please enter password"); // Yêu cầu người dùng nhập pass (ở trên)
if (Eingabe == pw) {
window.location.href = String.fromCharCode(97, 98, 114, 97, 101) + ".htm"; // Nếu nhập pass đúng thì chuyển đến trang /abrae.htm
} else {
alert("Try again"); // Nhập pass sai thì thông báo "Try again"
}
}
1 Like