프로그램/script 70

async.js waterfall 사용방법

ajax 콜을 여러번 시리얼하게 요청 하고자 한다면... 아래의 async waterfall 을 사용하길 추천 합니다... Project : https://github.com/caolan/async Guide: http://hatemogi.com/holiday-project-day-10/waterfall(tasks, [callback])Runs the tasks array of functions in series, each passing their results to the next in the array. However, if any of the tasks pass an error to their own callback, the next function is not executed, and the ma..

프로그램/script 2015.11.24

jQuery plugin 개발용 템플릿

jQuery plugin개발을 위한 손쉬운 방법이 있어 공유 합니다. 아래와 같은 형태로 작업을 하면 기존의 방법보다 훨씬 편한것 같습니다. 아래 부분이 키포인트 같아서 발춰해봅니다. $.fn[pluginName] = function(options) { // Iterate through each DOM element and return it return this.each(function() { // prevent multiple instantiations if (!$.data(this, 'plugin_' + pluginName)) { $.data(this, 'plugin_' + pluginName, new Plugin(this, options)); } }); }; Plugin의 접근을 $(p1).data..

프로그램/script 2015.09.24

[javascript] Mobile Tablet 검사하기.

브라우져에서 Mobile, Tablet 클라이언트 검사하기: 출처: 옥션. / 기기 체크 // isTablet()과 isMobile()은 HP와 SRP에서 사용 중 function isMobileDevice() { var phoneArray = new Array('samsung-', 'sch-', 'shw-', 'sph-', 'sgh-', 'lg-', 'canu', 'im-', 'ev-', 'iphone', 'nokia', 'blackberry', 'lgtelecom', 'natebrowser', 'sonyericsson', 'mobile', 'android', 'ipad'); for (i = 0; i < phoneArray.length; i++) { if (navigator.userAgent.toLow..

프로그램/script 2014.02.12

JavaScript TCP/IO by Flash Socket Bridge

JavaScript로 원격네트웍을 이용할 수 있을까???쉽지않죠... 가장 쉽게 떠올리는건 HTML5 WebSocket 일겁니다.그러나, 사용상의 제약도 많고 브라우져 특성도 무시 못합니다.그렇다면 대안이 뭘까 ??? 생각해보면 Flash Network API를 이용하고 이걸 Javascript Callback과 연결하면 되지 않을까요 ?...이미 이러한 아이디어는 오래전부터 있어 왔네요... 일단 참고 URL 만 모아 두고, 차근차근 연구해야 될것 같습니다.암튼 좋은 아이디어고, 쓸만할것 같습니다. 아래는 참고 페이지들 입니다. http://matthaynes.net/blog/2008/07/17/socketbridge-flash-javascript-socket-bridge/ http://blog.ion..

프로그램/script 2013.11.21