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 getAjax(url,params,method){ | |
var xhr = XMLHttpRequest ? new XMLHttpRequest() : (window.ActiveXObject && new ActiveXObject("Microsoft.XMLHTTP")) || null; | |
var _deff = function(){this.fn={};}; | |
_deff.prototype.text=function(fn){this.fn.text=fn;} | |
var get = new _deff(); | |
xhr.onreadystatechange = function(){ | |
if (xhr.readyState === 4) { | |
if('text' in get.fn&&typeof(get.fn.text)=='function') get.fn.text.call(xhr,xhr.responseText); | |
} | |
}; |
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
/* | |
by Composite (http://blog.hazard.kr) | |
reference - | |
http://stackoverflow.com/questions/4845762/onload-handler-for-script-tag-in-internet-explorer | |
Usage - | |
getScript('http://www.domain.com/js/myscript.js','utf-8').then(function(){ | |
myMethod('yay!'); | |
}); |
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
/** | |
* prepared iFrame for javascript | |
* Composite (ukjinplant at msn dot com) | |
* http://composite.tistory.com | |
* usage : | |
* preparedFrame('child') | |
* .prepare(function(){ | |
* form.target='child'; | |
* form.submit(); | |
* }).load(function(){ |
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 setQueue(func){ | |
setQueue.fns.push(func); | |
if(!setQueue.isRun){setQueue.isRun=true;setQueue.invoke();} | |
} setQueue.delay=0;setQueue.fns=[]; | |
setQueue.invoke=function(){ | |
setTimeout(function(){ | |
if(!setQueue.fns.length||!setQueue.isRun){setQueue.isRun=false;return;} | |
var fn=setQueue.fns.shift(); | |
if(typeof(fn)=='function') fn(); | |
setTimeout(arguments.callee,setQueue.delay); |
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 preventKey(){ | |
var shift=[].shift,e=window.event; | |
if(isNaN(+arguments[0])) e=shift.call(arguments)||e; | |
for(var i=0,len=arguments.length;i<len;i++){if((e.which||e.keyCode)==arguments[i]) return false;} | |
} |
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 numberFormat(n){ | |
if(isNaN(+n)||+n<1e3) return n; | |
n=n+'';var s='';for(var i=n.length-1;i>=0;i--) s+=n.charAt(i);n=''; | |
for(var i=s.length-1;i>=0;i--) n+=s.charAt(i)+(!(i%3)?',':''); | |
return n.replace(/,$/,''); | |
} |
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
/* | |
usege : | |
document.createElementWith('button',{ | |
attr:{type:'button'}, | |
name:'mybutton',value:'myvalue', | |
style:{border:'1px solid red'}, | |
init:function(){ | |
this.onclick=function(){ | |
alert('my button clicked.'); | |
}; |
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
charsetencodes['euckr']={"\uac02":"%81%41","\uac03":"%81%42","\uac05":"%81%43","\uac06":"%81%44","\uac0b":"%81%45","\uac0c":"%81%46","\uac0d":"%81%47","\uac0e":"%81%48","\uac0f":"%81%49","\uac18":"%81%4A","\uac1e":"%81%4B","\uac1f":"%81%4C","\uac21":"%81%4D","\uac22":"%81%4E","\uac23":"%81%4F","\uac25":"%81%50","\uac26":"%81%51","\uac27":"%81%52","\uac28":"%81%53","\uac29":"%81%54","\uac2a":"%81%55","\uac2b":"%81%56","\uac2e":"%81%57","\uac32":"%81%58","\uac33":"%81%59","\uac34":"%81%5A","\uac35":"%81%61","\uac36":"%81%62","\uac37":"%81%63","\uac3a":"%81%64","\uac3b":"%81%65","\uac3d":"%81%66","\uac3e":"%81%67","\uac3f":"%81%68","\uac41":"%81%69","\uac42":"%81%6A","\uac43":"%81%6B","\uac44":"%81%6C","\uac45":"%81%6D","\uac46":"%81%6E","\uac47":"%81%6F","\uac48":"%81%70","\uac49":"%81%71","\uac4a":"%81%72","\uac4c":"%81%73","\uac4e":"%81%74","\uac4f":"%81%75","\uac50":"%81%76","\uac51":"%81%77","\uac52":"%81%78","\uac53":"%81%79","\uac55":"%81%7A","\uac56":"%81%81","\uac57":"%81%82","\uac59":"%81%83","\uac5a": |
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 ($) { | |
var spes = { checkbox: 1, radio: 1 }; | |
$.fn.validate = function (def, fns) { | |
if (!this.is('form')) return this; | |
var form = this.get(0); | |
if (!arguments.length && $.isFunction(form.__VALIDFUNC)) { | |
return form.__VALIDFUNC.call(form); | |
} | |
if (!$.isPlainObject(def)) return this; |
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
/** | |
* | |
* | |
* ajax-submit 클래스 추가 시 이벤트 바인딩 (첫번째 인자가 form event 객체임에 유의.) | |
* <code> | |
* $('#form').on('ajaxbefore', function(event, jqXHR, settings)); // | |
* $('#form').on('ajaxcomplete', function(event, jqXHR, testStatus)); // | |
* $('#form').on('ajaxsuccess', function(event, responseObject, testStatus, jqXHR)); // | |
* $('#form').on('ajaxerror', function(event, jqXHR, testStatus, errorThrown)); // | |
* </code> |
OlderNewer