How to Make Requests
- Open the developer tools on the web page (for Chrome, press F12).
- Go to the console.
- Enter the JavaScript function, for example:
goMenu('1018','admin');
.
- Press Enter to execute the function.
Example
JavaScript Code
function user_auth_check(needLevel, userLevel){
if(needLevel == userLevel){
return true;
}else{
return false;
}
}
function goMenu(code, userLevel){
switch (code){
case '1018':
if(user_auth_check('admin',userLevel)){
location.href="./fire_nuclear_Attack.php";
break;
}else{
alert('You do not have permission.');
break;
}
case '1129':
location.href="./logout.php";
break;
default:
alert('This menu does not exist.');
}
}
Webpage Button Code
<a class="btn btn-lg btn-danger" href="#" role="button" onclick="goMenu('1018','')">Fire</a>
댓글 없음:
댓글 쓰기