This repository was archived by the owner on May 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.js
More file actions
54 lines (50 loc) · 1.44 KB
/
Copy pathcommon.js
File metadata and controls
54 lines (50 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//Backspace, F5, Ctrl + r 새로고침 막기 http://pyonji.tistory.com/18
$(document).keydown(function(e) {
key = (e) ? e.keyCode : event.keyCode;
var t = document.activeElement;
if (key == 8 || key == 116 || key == 17 || key == 82) {
if (key == 8) {
if (t.tagName != "INPUT") {
if (e) {
e.preventDefault();
} else {
event.keyCode = 0;
event.returnValue = false;
}
}
} else {
if (e) {
e.preventDefault();
} else {
event.keyCode = 0;
event.returnValue = false;
}
}
}
});
// 사운드 재생 http://zzino.co.kr/blog/?p=292
var player = new Audio('');
function soundPlay(URL){
if(player.paused || url != player.src){
if(player.canPlayType('audio/mp3')){
player.src = URL;
}
player.play();
}else{
player.pause();
player.currentTIme = 0;
}
}
function waitPlayer () {
$.ajax({
type:"GET",
url:"waitPlayer.jsp",
success:function(data){
if(parseInt(data))
location.replace("battleship.jsp");
},
error:function( xhr, status, error ){
console.log(xhr + "\n" + status + "\n" + error);
}
});
}