var validator = { types : {}, messages : [], config: {}, validate: function( data ) { var i, msg, type, checker, result_ok; this.messages = []; for ( i in data ) { if ( data.hasOwnProperty(i) ) { type = this.config[i]; checker = this.types[type]; if ( !type ) { continue; } if ( !checker ) { throw { name : "validationError", message : type + ' noting ' }; } result_ok = checker.validate( data[i] )..
http://www.naver.com/include/timesquare/widget/exchange.xml 네이버는 막혔다. 흑. 래퍼를 NAVER 를 걸쳐서 가면 댄다든댕.. 패스 http://www.webservicex.net/CurrencyConvertor.asmx?op=ConversionRate http://www.webservicex.net/CurrencyConvertor.asmx/ConversionRate?FromCurrency=USD&ToCurrency=KRW 구굴 환율 계산 api $amount = "1000"; $from = "USD"; $to = "KRW"; echo ""; print_r( currency($from, $to, $amount) ); echo ""; exit; functi..
keycode = { getKeyCode : function(e) { var keycode = null; if(window.event) { keycode = window.event.keyCode; }else if(e) { keycode = e.which; } return keycode; }, getKeyCodeValue : function(keyCode, shiftKey) { shiftKey = shiftKey || false; var value = null; if(shiftKey === true) { value = this.modifiedByShift[keyCode]; }else { value = this.keyCodeMap[keyCode]; } return value; }, getValueByEven..
constructor 속성은 객체를 만드는 기능함수를 반환하거나, 설정을 하는 메소드 이다. 생성된 객체의 constructor 속성을 통해 해당 생성자 함수와 일치 여부가 가능하다 function A() { this.name = "A함수"; this.getName = function() { return this.name; } } a = new A(); document.writeln(a.constructor); //function A() { this.name = "A\uD568\uC218"; this.getName = function () {return this.name;}; } document.writeln(a.constructor == A); //결과 : true function A() { this...
/** * 트위터 bootstrap js 패턴 */ ;(function($){ var Calculator = function( el, options ) { this.$el = $(el); this.options = $.extend({} , $.fn.calculator.defaults, options); } Calculator.prototype = { constructor : Calculator , show : function(){ console.log( this.options ); } } $.fn.calculator = function ( option ) { return this.each(function(){ var $this = $(this) , data = $this.data('calculator')..