개발Story
[Javascript] jquery. keypress(중복 키 조합)
Javascript/jquery 2022. 11. 13. 18:49

$(document).bind('keypress', (event) =>{ // shift + a 조합키 if( event.which === 65 && event.shiftKey ) { console.log('shift + a 조합키 감지') } }); jquery를 이용하여 사용자 키보드 입력에 대한 이벤트를 감지가 가능하다. shift, ctrl, alt, meta 키와 일반 키를 동시에 눌렀을 때 위와 같은 방식으로 이벤트를 줄 수 있다. event.shiftKey event.ctrlKey event.altKey event.metaKey [keyCode 표] 출처 : https://im-developer.tistory.com/20 키 코드 : https://www.cambiaresearch.com/a..

통신값에서 받은 blob 다운로드 처리(.fetchAPI 이용)
Javascript/통신 2021. 7. 3. 17:14

프로젝트를 진행하면서 API통신을 이용해 BLOB값을 받아 파일을 다운로드 할 필요가 있었다. 보통 JQUERY AJAX통신을 이용하여 API를 진행하였다. 예를 들어 $.ajax({ url:'example.php' // 요청 할 주소 async:true,// false 일 경우 동기 요청으로 변경 type:'POST' // GET, PUT data: { Name:'ajax', Age:'10' },// 전송할 데이터 dataType:'text',// xml, json, script, html beforeSend:function(jqXHR) {},// 서버 요청 전 호출 되는 함수 return false; 일 경우 요청 중단 success:function(jqXHR) {},// 요청 완료 시 error:f..