CINXE.COM

통신판매 사업자정보 조회

<!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" > <meta name="format-detection" content="telephone=no" > <title>통신판매 사업자정보 조회</title> <link href="/site/www/css/sub.css" type="text/css" rel="stylesheet" > <script src="/site/guide/js/jquery.min.js"></script> </head> <body> <div class="captcha-wrap"> <div class="captcha-box" style="margin-left: auto;margin-right:auto"> <img id="captchaImg" title="캡차이미지" src="/bizCaptchaImg.do" alt="캡차이미지"/> <div id="ccaudio"></div> </div> <div class="helper-box refer" style="margin-left: auto;margin-right:auto"> <p class="helper-tit"> 위에 보이는 문자를 입력해 주세요. </p> </div> <div class="captcha-form" style="justify-content: end;margin-left: auto;margin-right:auto"> <input id="reload" type="button" onclick="getImage()" value="새로고침" class="btn tertiary sm"> </div> <div class="captcha-form" style="margin-left: auto;margin-right:auto"> <input name="answer" id="answer" type="text" value="" maxlength="6" class="form-control sm"> <input id="check" type="button" value="입력" class="btn primary sm"> </div> </div> <form name="bizCommPopForm" id="bizCommPopForm" method="post" action="/bizCommPop.do"> <fieldset> <input type="hidden" name="wrkr_no" id="wrkr_no" value="1248100998"/> </fieldset> </form> <script> window.onload = function(){ getImage(); // 이미지 가져오기 document.querySelector('#check').addEventListener('click', function(){ var params = {answer : $('#answer').val()}; $.ajax({ url : '/bizChkAnswer.do', type : 'POST', data : params, success : function(returnData) { if( returnData == 200 ) { //console.log('Captcha Success !!'); var obj = document.getElementById("bizCommPopForm"); obj.submit(); } else { alert('입력값이 일치하지 않습니다.'); getImage(); document.querySelector('#answer').setAttribute('value', ''); } }, error : function(xhr, status, error) { alert('Captcha error : 잠시 후 다시 시도해 주세요.'); } }); }); } /*매번 랜덤값을 파라미터로 전달하는 이유 : IE의 경우 매번 다른 임의 값을 전달하지 않으면 '새로고침' 클릭해도 정상 호출되지 않아 이미지가 변경되지 않는 문제가 발생된다*/ function audio(){ //var rand = Math.random(); var rand = secureRandom(); var uAgent = navigator.userAgent; var soundUrl = '/bizCaptchaAudio.do?rand='+rand; if(uAgent.indexOf('Trident')>-1 || uAgent.indexOf('MISE')>-1){ /*IE 경우 */ audioPlayer(soundUrl); }else if(!!document.createElement('audio').canPlayType){ /*Chrome 경우 */ try { new Audio(soundUrl).play(); } catch (e) { audioPlayer(soundUrl); } }else{ window.open(soundUrl,'','width=1,height=1'); } } function getImage(){ //var rand = Math.random(); var rand = secureRandom(); var url = '/bizCaptchaImg.do?rand='+rand; $("#captchaImg").attr('src', url); } function audioPlayer(objUrl){ document.querySelector('#ccaudio').innerHTML = '<bgsoun src="' +objUrl +'">'; } function secureRandom() { return (window.crypto || window.msCrypto).getRandomValues(new Uint32Array(1))[0]/4294967296; } </script> </body> </html>