일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 자바
- mariaDB
- db
- Linux
- data
- java
- framework
- learning
- Analysis
- LIST
- interface
- 인공지능
- Deep
- Spring
- Github
- DeepLearning
- Web
- 함수
- Server
- Python
- javascript
- Numpy
- SSH
- ai
- Pattern
- mysql
- error
- Security
- centos
- git
- Today
- Total
목록Script/JavaScript (19)
PostIT
Javascript의 Some이란?JavaScript를 사용하여 과제 중 Some을 통해 어려움을 해결할 수 있었습니다. forEach를 사용하면 list 안의 유효성 검사를 하고 문제가 생길 시 return하는 부분에 대한 불완전성이 있었습니다. 하지만, Array의 Some을 사용하여 이를 해결할 수 있었습니다.과제의 내용은 react와 비슷한 mithril 과제였습니다. 참고자료는 Mithril JS Example 에서 보실 수 있습니다.Some이란?배열의 모든 요소에 대해 지정된 콜백 함수가 true를 반환하는지 여부를 결정합니다.설명callbackfn 함수가 true를 반환할 때까지 some 메서드는 각 배열 요소에 대해 오름차순 인덱스 순서로 callbackfn 함수를 호출합니다. callba..
# [HTML/JavaScript] Html의 이벤트 종류들## 1. 목적Javascript의 Module Pattern을 사용하여 해당 스크립트를 재사용 할 수 있는 장점이 있으며, 다른 소스와 섞이지 않고, 해당 모듈을 통해서 완전한 기능을 제공 할 수 있다. 하지만, 모듈 패턴을 적용하여 구성하면, HTML의 이벤트 코드를 통해 스크립트를 작동시키는게 많아진다. 이를 위해서는 해당 HTML Tag에 제공되는 이벤트에 대한 지식이 필요하다. 이를 위해 정리하였다.## 2. 내용이벤트발생onabort이미지 로딩에서 이탈하였을 때(다른 연결로 이동)onactivate개체의 activeElement 속성을 설정하였을 때onafterprint관련된 문서를 인쇄하거나 인쇄 미리보기를 후 즉시onbeforeac..
# 파일 업로드 전에 파일 정보 체크하기. 파일 업로드 시에는 WAS나 자체 내 파일 문제로 에러가 발생 될 수 있다. 이러한 에러처리를 하는 것은 당연하다. 하지만, 유저 입장에서 간단하게 파일을 체크하여, 되는지 안되는지를 아는 것이 더 중요한 것으로 판단된다. 그래서 파일을 올릴 때, 변화여부를 체크하여 파일정보를 볼 수 있게 해야한다. var CommonFunctionModule = (function() { //File Info & Validation Check var checkFileBeforeUpload=function(htmlTagId){ var files = document.getElementById(htmlTagId); // binds to onchange event of the inpu..
# URI, Protocol, HOST Javascript에서 값 가져오기. window.location.protocol Return) http: window.location.host Return) localhost:8080 window.location.pathname Return) /projectName/currentPath
# Ajax에서의 async로 해결, 하지만 또 다른 문제의 발생 최근 수정일 : 2017.04.18 ## 1. 배경 1차 Stomp를 이용한 비동기 통신 Message를 주고받는 과정에서 Message데이터를 Bootstrap Popover에 값을 넣어주는 부분에서 비동기 데이터를 가져오지 못하는 문제가 발생되었다. 이부분을 해소하기 위해 Ajax 통신의 비동기를 false로 해주어 문제를 해결하였다. 이 상황의 소스코드를 보면 아래와 같다./* content 부분에서 getMessageList 호출 */ var $popover=$('#openPopover').popover({ placement: 'bottom', template: '', html: '알림창', title : '알림창'+ '전체 보기'..
Object.create(); Object.create = function(o){function F(){}F.prototype = o;return new F();} 익스플로러 9버전 이후부터 지원 new 키워드를 사용할 떄와는 달리 전체적으로 소스의 생성자의 개념이 약해지고, 객체의 인스턴스 간의 상속을 강조하는 것. var person = {yell : function (){alert(“My Name is “ + this.name);}}; var example = Object.create(person);example.name=“Hooney”;example.yell(); // ===“My Name is Hooney” console.log(example instances person); // ===Type..
[Javascript] event.keyCode 코드값https://blog.lael.be/post/75 Key Code Reference Table01020Caps Lock3040Arrow Down111213141212223242313Enter2333Page Up434142434Page Down445152535End45Insert616Shift2636Home46Delete717Ctrl27Esc37Arrow Left478Backspace18Alt2838Arrow Up4809Tab19Pause/Break2939Arrow Right4915026070f80p90z51361=+71g81q91Windows5246272h82r925356373i83s93Right Click5466474j84t9455765a75k85..
jQuery로 Array 안에있는 값을 찾아 지워주기 var binding= new Array(); binding.push(1); binding.push(2); binding.push(3); console.log("Before binding cancel : "+binding); //Before binding cancel : 1,2,3 binding.splice($.inArray(1, binding),1); console.log("After binding cancel : "+binding); //After binding cancel : 2, 3
# jQuery에서 Append & Remove 처리하기. var html=""; html= "" + ""+item.surveyId+"" + ""+item.surveyName+"" + "취소" + ""; 1.Prepend$("#surveyBindingDiv").prepend(html);//surveyBindingDiv에 자식노드로 맨 위에 들어간다. 2.Append$("#surveyBindingDiv").append(html);//surveyBindingDiv에 자식노드로 맨 아래 들어간다. 3.Remove $("#surveyIdDiv"+surveyId).remove();//#(id)값의 태그를 찾아서 지워준다.
# JavaScript에서 배열 혹은 스트링 안에 우리가 원하는 값의 존재여부 확인 1. includes var str="Hello JavaScript"; console.log("str.includes('Java') : "+str.includes('Java')); //str.includes("Java") : true console.log("str.includes('java') : "+str.includes('java')); //str.includes('java') : false var binding=new Array(); binding.push(item.surveyId); //item.surveyId : 1 console.log("binding.includes(item.surveyId) : "+bindi..