2. 아래 코드를 Html 부분에 붙여넣기
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
<script type="text/javascript">
var password = ''
password=prompt('비밀번호를 입력해주세요','');
if(password == null){
if(window.history.length == 0 || window.history.length == 1){
this.close()
}
else{
window.history.back();
}
}
else if (password == '테스트입니다') { //테스트입니다 << 부분에 원하는 비밀번호 입력
//비밀번호가 일치 할 경우
}
else{
if(window.history.length == 0){
this.close()
}
else{
window.history.back();
}
}
</script>
| cs |

3. 해당 게시글에 접속 후 테스트한다.
0 댓글