라벨이 자바인 게시물 표시

jquery에서 페이지 동적 로드 시 css 적용문제 해결하기

jquery에서 post나 get등을 통해서 페이지를 로딩하고 이를 div등을 통해 출력시 css가 적용이 안되는 문제가 발생하는 경우에  trigger("create")를 붙여주면 css가 적용된다.~ ==>  $('#list').html(data).trigger("create");

nodejs 소켓.io 사용 웹소켓 간단 구현

 var http = require('http');  var fs = require('fs');  var socketio = require('socket.io');  var server = http.createServer(function(request,response){      fs.readFile('ok.html',function(error,data){          response.writeHead(200,{'Content-Type':'text/html'});          response.end(data);      });  }).listen(3000, function(){      console.log('server running 3000 port!');  });  var io = socketio.listen(server);  io.sockets.on('connection', function(socket){      socket.on('message', function(data){         io.sockets.emit('message',data);          });  });

nodejs 설치 방법 (리눅스)

nodejs 설치 방법 컴파일 툴 설치 1. Install Required Packages # yum groupinstall "Development Tools" # yum install screen   노드소스 다운로드 2. Download Node.js Source # cd /usr # wget http://nodejs.org/dist/v0.10.34/node-v0.10.34.tar.gz # tar xzf node-v0.10.34.tar.gz # cd node-v0.10.34 노드 컴파일 3. Extract and Compile Node.js # python2.7 ./configure # make install 노드 콤포넌트 설치 4. Configure Example Application using Express # npm -g install express # npm -g install supervisor # npm -g install forever

nodejs용 python 최신버전 인스톨

python 최신버전 인스톨 nodejs는 2.7버젼을 필요로 하지만 레드햇(센토스)버젼에는 2.4버젼에 인스톨되어 있습니다. 삭제는 불가능하므로 2.7버젼을 설치 방법입니다. 1. GCC컴파일러 설치. (설치가 되어 있지 않다면)     yum install gcc 2. cd /usr/src     wget https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz 3. 압축해제     tar xzf Python-2.7.8.tgz     cd Python-2.7.8     ./configure     make altinstall     "make altinstall is used to prevent replacing the default" -> 기본값이 대체되는 것을 방지     python binary file /usr/bin/python. -> 바이너리 파일 위치(확인) 4. 버젼확인     python2.7 -V

nodejs npm으로 package.json 만들기

npm에는 package.json을 생성해 주는 명령어가 존재 npm init 명령어. npm init 명령어를 사용하면 인터렉티브 프롬프트가 동작하면서 프로젝트에 대한 여러가지 정보를 입력할 수 있게 되고 그 정보를 기반으로 기본적인 package.json을 만들며, 기본적인 package.json은 위와 같이 만들 수 있지만 실제적으로 이 파일에서 의존성 라이브러리에 대한 정보를 관리해 주는 것이 좋다. 그러나 npm으로 모듈 설치시마다 package.json을 수정해 주는 것은 매우 귀찮음 그래서 설치시에 package.json의 dependencies 부분을 업데이트 해주는 옵션이 존재함. 그것이  npm install 모듈명 --save 로 모듈 설치시 --save라는 옵션을 붙혀주면 로컬에 모듈을 설치하면서 자동적으로 package.json을 업데이트 해 줍니다. package.json의 dependencies 부분을 업데이트 함.  내용펌 http://blog.outsider.ne.kr/674

펌)JQuery Select Box 제어

1. jQuery로 선택된 값 읽기 $("#selectBox option:selected").val(); $("select[name=name]").val(); 2. jQuery로 선택된 내용 읽기 $("#selectBox option:selected").text(); 3. 선택된 위치 var index = $("#test option").index($("#test option:selected")); 4. Add options to the end of a select $("#selectBox").append(" Apples "); $("#selectBox").append(" After Apples "); 5. Add options to the start of a select $("#selectBox").prepend(" Before Apples "); 6. Replace all the options with new options $("#selectBox").html(" Some oranges MoreOranges "); 7. Replace items at a certain index $("#selectBox option:eq(1)").replaceWith(" Someapples "); $("#selectBox option:eq(2)").replaceWith(" Somebananas "); 8. 지정된 index값으로 select 하기 $("#selectBox option:eq(2)").attr("selected...

jquery 커스텀 스크롤 적용 - nicescroll 사용

스크립트링크 jquery 구현코드 $(function() {    $("html").niceScroll(); } nicescroll 링크

jeus admin command 정리

ja : jeus 어드민 모드로 이동 pidlist : 프로세스 리스트로 프로세스 아이디(pid)를 확인 할 수 있음. dsinfo : DB 정보 출력 conlist : 컨테이너 리스트  및 상태 확인 applist : 제우스에 deploy 된 어플리케이션 확인 jnidlist : jndi 연결리스트를 가져온다. meminfo : 제우스 메모리 사용 현황 st -m : 메모리 정보 확인 ( vm memory ) ti : Thread State boot : 제우스 서버 부팅 down startcon downcon q : 나가기 h : 헬프    출처:http://130star.wordpress.com/2012/06/20/webtob-jeus-%EA%B0%84%EB%8B%A8-%EC%9A%B4%EC%98%81%EB%B2%95/

extjs form submit - iframe 대체 - 엑셀 다운로드 구현

var hiddenForm = Ext.create('Ext.form.Panel', {  title:'hiddenForm',  standardSubmit: true,  url: myhost + "/excel.do",  timeout: 120000,  height:0,  width: 0,  hidden:true,  items:[    {xtype:'hiddenfield', name:'token', value:token},    {xtype:'hiddenfield', name:'param', value:JSON.stringify(param)}  ] }); hiddenForm.getForm().submit() standardSubmit: true, ==> iframe과 동일하게 다운로드를 구현할 수 있음. 즉 iframe 의 post호출 버전 쯤 될듯. form 의 item 부분에 원하는 파라미터 값을 매핑해서 채워준뒤 submit하게 됨. 엑셀 저장 다운로드 구현시 사용 하면 유용 함.!!

ExtJs Store to Json convert

getJsonDataForStore: function(store){         var data = new Array();         var result = "";         var records = store.getRange();         for (var i = 0; i < records.length; i++) {             data .push(records[i].data);         }         result = Ext.JSON.encode(data );         return result ;     },

이클립스 자바스크립트 플러그인 Spket IDE. 업데이트 경로

This is the update site for Spket IDE. To use it, open Eclipse's UpdateManager (under the Help menu in Eclipse) and add a bookmark for http://www.agpad.com/update

자바스크립트 로컬스토리지

var value= localStorage.getItem(name) localStorage.setItem(name, object.value)

자바스크립트 타이머 등록/해제(window.setInterval && window.clearInterval)

configs:{   timeChecker: null  }, var me = this; //시작 (1000 = 1초) me.timeChecker = setInterval(function(){me.myFunction()},60000); //중지 clearInterval(timeChecker);

Extjs 딜레이 설정.

setTimeout(function(){ // 내용 }, 1000) 1초 딜레이 설정

Extjs 그리드 체크박스-추가

var testgrid = Ext.create('Ext.grid.Panel', {         store: store,         columns: [{      xtype: 'checkcolumn',             header: 'Active?',             dataIndex: 'test',             width: 60,             editor: {                 xtype: 'checkbox',                 cls: 'x-grid-checkheader-editor'             }         }  });

자바스크립트 한글 문자열 자르기

hangulCut: function(str,len) { var str2 = str;         var s = 0 , cknum=0;         for (var i=0; i             s += (str.charCodeAt(i) > 128) ? 2 : 1;             if (s > len){        str = str.substring(0,i);        str2 = str2.substring(i,80)+'...'; return { firstNm: str, endNm: str2}             }         }         return { firstNm: str, endNm: ''}; },

자바스크립트 전체화면처리 - 브라우져 F11

function requestFullScreen() { /*var element = document.body; console.debug(element);     // Supports most browsers and their versions.     var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullScreen;     if (requestMethod) { // Native full screen.         requestMethod.call(element);     } else if (typeof window.ActiveXObject !== "undefined") { // Older IE.         var wscript = new ActiveXObject("WScript.Shell");         if (wscript !== null) {             wscript.SendKeys("{F11}");         }     }*/ var docElm = document.documentElement; if (docElm.requestFullscreen) {    docElm.requestFullscreen(); } else if (docElm.mozRequestFullScreen) {    docElm.mozRequestFullScreen(); } else if (docElm...

자바스크립트 timer 관련

자바스크립트 타이머 시작 me.timeChecker = setInterval(function(){me.getTime()},1000); //1초간격 타이머 종료 clearInterval(me.timeChecker);

자바스크립트 replaca All 구현하기

var result = "2013-03-03"; result = result. split (","). join (""); ==> "20130303"

자바스크립트 function override callparent 사용하기

자바스크립트 function override callparent 사용하기(replace All 포함) setValue: function(value){     var me = this; --비지니스--     me.superclass.setValue.call(me, value); }, getValue: function(){     var me = this;     var result = me.superclass.getValue.call(me);     result = result.split("-").jojn(""); -- "-"제거     result = result.split(",").join("");     return result; },