2015년 4월 26일 일요일

ajax와 request of node

사실 둘다, get, post를 한다는 것은 동일한데, ajax로 구현한 것을 server side인 node에서 구현해야 할때도 있다.

그럴때, 참고하기 위해 실제 동작은 동일하지만 구현법이 다른 두개 비교 해둔다.

jquery의 ajax post

$.ajax({ url:"/login", type:"post", 
  data:{userId:"userA", userPwd:"pwdA"},
  success : function(response) {
    console.log(response);
}, 
  error : function(request, response, error) {
    console.log(request);
}});

node.js의 request post

request.post("/login", {
    json: false,
    form: {userId:"userA", userPwd:"pwdA"}
}, function (error, response, body) {
    if (error) {
        return console.error(error);
    }
    return console.log(body);
});



from WordPress http://ift.tt/1Dojezm

2015년 4월 9일 목요일

vi에서 한글 encoding 변환하기.

vi에서 한글이 ??? 깨져서 보이는 경우가 있는 이 경우에는 encoding 을 아래와 같이 변환해야 한다.



:e ++enc=euc-kr



자꾸 잊어버려 기록 차원에서 남긴다.








from WordPress http://ift.tt/1FDPsux