This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* [searchAddr 다음주소검색 API] | |
* @return {[JsonArray]} [주소데이터] | |
* <script src="http://dmaps.daum.net/map_js_init/postcode.v2.js">가 선행되어야함 | |
*/ | |
var searchAddr = function(){ | |
new daum.Postcode({ | |
oncomplete: function(data){ | |
var fullAddr = ''; // 최종 주소 변수 | |
var extraAddr = ''; // 조합형 주소 변수 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="/bower_components/clipboard/dist/clipboard.min.js"></script> | |
<!-- 1. URL copy --> | |
<a href="#" id="btnCopyUrl" data-clipboard-action="copy" >url 복사</a> | |
<script> | |
$(function({ | |
// 복사 버튼을 만들시 data-clipboard-text 안에 복사할 문구를 넣어준다 | |
$('#btnCopyUrl').attr('data-clipboard-text', document.location.href); | |
// callback 설정 | |
var clipboard = new Clipboard('#btnCopyUrl'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="stylesheet" type="text/css" href="/bower_components/datetimepicker/build/jquery.datetimepicker.min.css"> | |
<!-- php.date.formatter.js 와 jquery.mousewheeel.js 를 포함하는 full.js--> | |
<!-- moment는 이미 선언되어있다고 가정합니다 --> | |
<script src="/bower_components/datetimepicker/build/jquery.datetimepicker.full.min.js"></script> | |
<script> | |
// dateTimePicker localization | |
$.datetimepicker.setLocale('ko'); | |
// dateTimePicker moment.js와 연동 | |
$.datetimepicker.setDateFormatter({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
$.validator.setDefaults({ | |
onfocusout: false, | |
invalidHandler: function(form, validator) { // 커스텀 포커스 핸들링 | |
if (validator.numberOfInvalids()) { | |
validator.errorList[0].element.focus(); | |
//alert(validator.errorList[0].message); // 경고창 | |
} | |
}, | |
errorClass:'text-danger', // 에러 스타일을 입힐 클래스 지정 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// p 태그를 이용하는 방법 | |
$.validator.setDefaults({ | |
errorClass: "invalid form-error red-text", | |
errorElement : 'p', | |
errorPlacement: function(error, element) { | |
var e = element.get(0); | |
if(e.type==='radio' || e.type==='checkbox'){ | |
var $a = error.appendTo(element.parent()); | |
$a.css({'margin-top':'10px'}); | |
}else{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// function | |
function comma(num){ | |
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); | |
} | |
// prototype | |
Number.prototype.format = function(){ | |
return this.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// === PHP time(); | |
var timestamp = Math.round(new Date().getTime() / 1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 세션을 만들어줄 서버에서 P3P 헤더를 설정 --> | |
<?php | |
header('P3P: CP="CAO PSA OUR"'); | |
?> | |
<!-- 세션을 가지고 오는 클라이언트 요청--> | |
<script> | |
$.ajax({ | |
url:'cross domain session create url', | |
type:'post', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var totalCount; | |
var currentPageNum; | |
var shownRowNum; | |
for(var i=0, len=data.length; i<len; i++){ | |
var index = (Number(totalCount)-(i+(currentPageNum-1)*shownRowNum)) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
function test(){ | |
if(true){ | |
return false; | |
} | |
} | |
</script> | |
<!-- 페이지에 return false;가 출력됨 --> | |
<a href='javascript:test();'>테스트</a> |
OlderNewer