我制作了这个小 JavaScript:
<script type="text/javascript">
if(perm == 0)
{
var perm = 0;
var password = "showrocks69";
var pass = prompt("[Login] Type in the Admin CP Password:","");
if(pass==password)
{
perm = 1;
window.location = "http://cod5showtime.url.ph/acp.html";
}
else
{
alert("[Error] Invalid Password!");
window.location = "http://cod5showtime.url.ph/";
}
}
</script>
<script type="text/javascript">
function acpLogout()
{
var perm = 0;
alert("[Log Out] Logged out from Administrator Account");
window.location = "http://cod5showtime.url.ph/";
}
</script>
这个按钮:
<button class="btn" onClick="acpLogout()">Log Out</button>
我想在有人单击注销时进行此操作,该人将被注销,即“perm”变量将设置为0。如上所示,我已尝试完成此操作,但它不起作用。有任何想法吗 ?