참조http://develop88.tistory.com/entry/%EC%9E%90%EB%B0%94%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8%EB%A1%9C-%EA%B0%81%EC%A2%85-%EA%B0%92%EB%84%98%EA%B8%B0%EB%8A%94%EB%B0%A9%EB%B2%95 Javascript로 Parameter 값을 넘기는 방식 GET방식 String type = "1"; String type2 = "2": 조회 function search(type,type2){ location.href="search.jsp?type="+type+"&type2=type"+type2; } function search(){ location.href="search.jsp?type=+&t..
참조http://blog.publisher.name/589 사업자등록번호, 핸드폰 번호 등 (-)하이픈이 들어가는 요소를 생성할때 자동생성 해주는 코드이다. 이 외에도 input box를 3개 생성하여 구성할 수 있으나 하나의 input box안에서 해결할 때 쓸 수 있는 방법이다. JavaScript function licenseNum(str){ str = str.replace(/[^0-9]/g, ''); var tmp = ''; if(str.length < 4){ return str; }else if(str.length < 7){ tmp += str.substr(0, 3); tmp += '-'; tmp += str.substr(3); return tmp; }else{ tmp += str.substr(..
참조http://blog.naver.com/PostView.nhn?blogId=sjpotato&logNo=40150731304&redirect=Dlog&widgetTypeCall=true JavaScript에서는 replaceAll을 사용할 수 없다. replace만 사용할 경우 String ABC = "ABCD-EFG-HGI".replace("-",""); 첫번째 문자만 변경되기에, ABC의 값은 'ABCDEFG-HGI'가 된다. 그럴때 정규식을 이용하여 replace를 replaceAll과 같이 사용할 수 있다. 정규식을 이용해 gi로 감싸기 abc.replace(/-/gi, “”); -를 감싼 따옴표를 슬래시로 대체하고 뒤에 gi 를 붙이면 replaceAll 과 같은 결과를 볼 수 있다. 정규식의..