<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="https://t-4user.yeskey.or.kr/v1/fincert.js?dt=20200814"></script>
</head>
<body>
<button id="issue" class="btn">인증서발급/재발급</button>
<button id="renew" class="btn">인증서 갱신발급</button>
<button id="renew2" class="btn">인ㅅㄴㅅ</button>
<script>
FinCert.Sdk.init({
"orgCode": "D200800001",
"apiKey": "fjVJqBSmuyAX...",
"lang": "kor",
"success": function() {
console.log("초기화 성공"); },
"fail": function(error) {
console.log(error.code + " : " + error.message);
}
});
const Yeskey = class {
constructor(id) {
if(typeof this[id] == 'undefined') throw '>>>naya ['+id+'] 메소드 추가해주세요.';
else this[id]();
}
issue() {
console.log('인증서 발급/재발급 시작');
}
renew() {
console.log('인증서 갱신발급 시작');
}
};
let btn = $(".btn").on('click', function(event) {
new Yeskey(this.id);
});
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="https://t-4user.yeskey.or.kr/v1/fincert.js?dt=20200814"></script>
</head>
<body>
<button id="issue" class="btn">인증서발급/재발급</button>
<button id="renew" class="btn">인증서 갱신발급</button>
<button id="renew2" class="btn">인ㅅㄴㅅ</button>
<script>
const Yeskey = class {
constructor(id) {
this.id = id;
}
exe() {
if(typeof this[this.id] == 'undefined') throw '>>>naya ['+id+'] 메소드 추가해주세요.';
else this[this.id]();
}
init() {
FinCert.Sdk.init({
"orgCode": "D200800001",
"apiKey": "fjVJqBSmuyAX...",
"lang": "kor",
"success": function() {
console.log("초기화 성공"); },
"fail": function(error) {
console.log(error.code + " : " + error.message);
}
});
}
issue() {
console.log('인증서 발급/재발급 시작');
}
renew() {
console.log('인증서 갱신발급 시작');
}
};
let btn = $(".btn").on('click', function(event) {
new Yeskey(this.id).exe();
});
let yk = new Yeskey();
yk.init();
</script>
</body>
</html>
'프로그래밍 > Js' 카테고리의 다른 글
웹워커 안에서 웹소켓 구동 시험 테스트 + Node 소켓 서버 (0) | 2021.11.09 |
---|---|
node + ws + express webSocket 샘플 예제 (0) | 2021.11.08 |
service worker push API 제작기 (1) - 권한요청 (0) | 2021.10.29 |
HTTP fetch() 요청 취소하는 방법 (0) | 2021.10.28 |
JavaScript Lexical Grammar (0) | 2021.10.21 |