본문 바로가기

javascript

bower 설치 및 사용하기, bower-installer bower 란? bower는 font-end package managerment이다. 오직 웹에 특화된 패키지 메니징 서비스이다. 이전에 작은 프로젝트를 할 때는 jquery나 angular 등을 모두 직접 다운받아서 사용했지만 프로젝트에서 쓰이는 파일들이 점점 많아지고 라이브러러들이 버전업할 때마다 새로 받아서 설치해야 한다면 여간 귀찮은 일이다. bower는 이러한 의존성 작업들을 자동화시켜 준다. bower 설치먼저 nodejs가 설치되어있다는 가정하에 전역(option:-g)으로 설치해주면 된다. $npm install -g bower 설치 확인 $bower -v bower 사용하기 $mkdir bower_test$cd bower_test$bower install jquery bower는 특이하게.. 더보기
angular js - eclipse plugin angular js - eclipse plugin - https://github.com/angelozerr/angularjs-eclipse/wiki/Getting-Started 더보기
Javascript에서 ||란? var $a = a || document; if (a !== undefined && a !== false && a !== null) {$a = a;} else {$a = document;} 더보기
자바스크립트에서는 this의 동적인 특성을 이용한 메타프로그래밍 메타프로그래밍은 코드가 어떤 동작을 하도록 구현하는 것을 프로그래밍이라고 한다면 어떤 것이 해석되는 방식을 바꾸도록 코드를 구현하는 것이다. 자바스크립트에서는 this의 동적인 특성을 이용해서 메타프로그래밍을 할 수 있다. Function.call 메서드로 Point2D 생성자를 이용해서 새로운 Point3D 형식을 만들수 있다. function Point2D(x, y) { this._x = x; this._y = y; } var result = new Point2D(0, 1); console.log(result);// Point2D {_x: 0, _y: 1} function Point3D(x, y, z) { Point2D.call(this, x, y); this._z = z; } var result2 .. 더보기
Underscore.js 좋은 javascript 라이브러리 하나 underscorejs.org var nums = [1, 2, 3, 4, 5]; function doubleAll(array) { return _.map(array, function(n) { return n * 2; }); } var result = doubleAll(nums); console.log(result);// [2, 4, 6, 8, 10] function average(array) { var sum = _.reduce(array, function(a, b, seq) { console.log("a : " + a + " , b : " + b + " , seq : " + seq); return a + b; }); return sum / _.size(array.. 더보기
javascript 개발방법 더보기
자바스크립트] 숫자 천단위 쉼표(콤마) 넣기; JavaScript Comma Number, Thousands Separator 퍼온곳 - > http://mwultong.blogspot.com/2006/12/javascript-comma-number-thousands.html 감솨요 역쉬 좋은 정보는 공유합시다!!! 더보기
AJAX 한글 파라미터 전송 한글인코딩이 문제 웹은 EUC-KR AJAX는 UTF-8 이런이슈가 나올때마다 삽질... 까먹지 말자. $(document).ready(function(){ $.ajax({ type:"post", url:"", dataType:"text", // 한글로 보내고, data:{tncode:'${tunnelCode}',key:'${key}',msg:encodeURIComponent('${msg}')}, success:function(data){ // 한글로 받는다. $('#memo').append(decodeURIComponent(data).split("+").join(" ")); }, error:function(data){ alert("status = " + data.status + " , error = ".. 더보기
jQuery로 json 객체 다루기 http://blog.byule.com/181 -- > 출처입니다. 더보기
jquery tree 와 ajax를 한꺼번에 jqueryAjaxTres002.jsp jQuery Treeview Plugin Demo test.jsp Folder 1 Item 1.1 Item 1.1.1 Folder 2 Subfolder 2.1 File 2.1.1 File 2.1.2 Subfolder 2.2 File 2.2.1 File 2.2.2 Folder 3 (closed at start) File 3.1 File 4 더보기