This file contains hidden or 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 onInitPage(){ | |
document.querySelector('#btn').addEventListener('click', handler, false) | |
var obj = document.querySelector('#btn'); | |
var evt = document.createEvent('MouseEvents'); | |
evt.initMouseEvent('click',true,true,window,10000,1000000000,0,0,0,false,false,false,false,0,null); | |
obj.dispatchEvent(evt); | |
} | |
function handler(evt){ | |
console.dir(evt) |
This file contains hidden or 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
M('#userID').on('blur', function(evt, mp){ | |
var strValue = mp.val(); | |
var id_pattern = new RegExp('[^a-zA-Z0-9]'); //아이디 패턴검사 정규식 | |
//아이디 값이 없거나 아이디가 유효한게 아니면 | |
if ( id_pattern.test(strValue) ) { | |
alert('아이디를 영문자와 숫자로 입력해 주세요.'); | |
mp.val(''); | |
return; | |
} | |
}); |
This file contains hidden or 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
window.addEventListener('blur', function(){ | |
window.open('','_self',''); | |
window.close(); | |
}, false) |
This file contains hidden or 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 SeUtil = { | |
/** | |
* date2Str | |
* Date Object or dateString을 Date Object로 변환하여 반환 | |
* | |
* params | |
* type : yyyy.MM.dd yyyyMMdd | |
*/ | |
date2date : function (date){ | |
if(date == null) return null; |
This file contains hidden or 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 type="text/javascript"> | |
function Car(_name, _size){ | |
this.name = _name; | |
this.size = _size; | |
} | |
// call | |
function renterCarCall(_name, _size){ | |
Car.call(this, _name, _size); |
This file contains hidden or 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
[].forEach.call(document.querySelectorAll(".func_footer .dim"), function(el) { | |
el.className = el.className.replace(/dim/g, "").trim(); | |
el.disabled = false; | |
}); |
This file contains hidden or 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
if((/chrome/gi).test(navigator.userAgent)){ | |
console.log("chrome") | |
} |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> | |
<style type="text/css"> | |
.view { | |
background:#eee;; width:400px; height:300px; | |
-webkit-perspective: 500px | |
} |
This file contains hidden or 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
/* trim utils */ | |
trim: function(_value){ | |
return _value.replace(/^\s+|\s+$/g,""); | |
}, | |
leftTrim: function(_value){ | |
return _value.replace(/^\s+/,""); | |
}, | |
rightTrim: function(_value){ | |
return _value.replace(/\s+$/,""); | |
}, |
This file contains hidden or 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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
<head></head> | |
<body> | |
</body> | |
<script type="text/javascript"> | |
window.addEventListener("load", init, false); |