본문 바로가기

Javascript & jQuqery6

Javascript) ajax 이후 특정 부분만 새로고침!! function uploadFeed(fd) { $.ajax({ url: "url", data: fd, method: "POST", processData: false, contentType: false, success: function (data) { console.log("성공"); }, error: function (request, status, error) { console.log("에러"); }, complete: function() { closeModal(); // location.reload(); // 리로드하고싶은 div 아이디값 적용 !! $('#left_body').load(location.href+' #left_body'); // 두번째 ' #left_body' 앞 공백까지 포함하기 !!.. 2022. 4. 27.
Javascript) Javascript & jQuery ajax & Promise 사용하기 동기적 프로그램 실행이 필요할때.. function doTheThing() { return new Promise((resolve, reject) => { $.ajax({ url: window.location.href, type: 'POST', data: { key: 'value', }, success: function (data) { resolve(data) // ajax 이후 실행 }, error: function (error) { reject(error) }, }) // and ajax }) } doTheThing() .then((data) => { // ajax 이후 실행 console.log(data) doSomethingElse() }) .catch((error) => { console.log(.. 2022. 4. 26.
JavaScript) highlight.js 사용하여 코드구문 강조 시키기 1. https://highlightjs.org/static/demo/ highlight.js demo highlightjs.org 2. 위 사이트에 접속하여 Themes에서 테마 이름 고르기 3. 테마 적용 시키는 법 - 스킨 편집 -> html 편집 -> 밑줄 친 부분에 테마 이름 적용 후 전체 소스를 사이에 넣고 적용 테마 이름 적용 꿀팁 - 대문자 -> 소문자 - 띄어쓰기 -> "-" - "/" 그대로 적용 - ex) Base16/Tomorrow Night -> base16/tomorrow-night 2022. 1. 9.
javaScript) jqgrid 명령어 var currentSortName = $("#gridID").jqGrid("getGridParam", 'sortname'); var currentSortOrder = $("#gridID").jqGrid("getGridParam", 'sortorder'); var currentRowNum = $("#gridID").jqGrid("getGridParam", 'rowNum'); var currentPage = $("#gridID").getGridParam('page'); // 페이지 var beforeCount = $("#gridID").getGridParam("reccount"); //그리드내 row갯수 var recordsCount = $("#gridID").getGridParam("records"); .. 2021. 7. 20.