링크: http://www.howtocreate.co.uk/tutorials/javascript/browserwindow


function getSize() {

  var myWidth = 0, myHeight = 0;

  if( typeof( window.innerWidth ) == 'number' ) {

    //Non-IE

    myWidth = window.innerWidth;

    myHeight = window.innerHeight;

  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {

    //IE 6+ in 'standards compliant mode'

    myWidth = document.documentElement.clientWidth;

    myHeight = document.documentElement.clientHeight;

  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {

    //IE 4 compatible

    myWidth = document.body.clientWidth;

    myHeight = document.body.clientHeight;

  }

  return [myWidth, myHeight];

}



function getScrollXY() {

  var scrOfX = 0, scrOfY = 0;

  if( typeof( window.pageYOffset ) == 'number' ) {

    //Netscape compliant

    scrOfY = window.pageYOffset;

    scrOfX = window.pageXOffset;

  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {

    //DOM compliant

    scrOfY = document.body.scrollTop;

    scrOfX = document.body.scrollLeft;

  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {

    //IE6 standards compliant mode

    scrOfY = document.documentElement.scrollTop;

    scrOfX = document.documentElement.scrollLeft;

  }

  return [ scrOfX, scrOfY ];

}


posted by 뚱2

[JavaScript] RegExr

JavaScript/JavaScript 2014. 6. 14. 00:15

자바스크립트 정규표현식 테스트 하기 좋은 곳

링크: http://www.regexr.com/


posted by 뚱2

[Highlight] Document

JavaScript/Highlight 2014. 6. 13. 16:27

링크: http://highlightjs.readthedocs.org/en/latest/api.html



'JavaScript > Highlight' 카테고리의 다른 글

[Highlight] highlight.js  (0) 2013.11.27
posted by 뚱2

링크: https://help.github.com/articles/github-flavored-markdown

링크: https://help.github.com/articles/markdown-basics

'JavaScript > Markdown' 카테고리의 다른 글

[Markdown] Markdown syntax  (0) 2013.12.17
posted by 뚱2

링크: http://blog.naver.com/goolungsoi?Redirect=Log&logNo=10112463395

'JavaScript > jQuery' 카테고리의 다른 글

[jQuery] jQuery plugin jmp3  (0) 2014.06.25
[jQuery] jquery-validation document  (0) 2014.05.07
[jQuery] jQuery-File-Upload  (0) 2014.05.06
[jQuery] jQuery Form validator  (0) 2013.11.18
[jQuery] jQuery.serializeObject 만들기  (0) 2013.10.15
posted by 뚱2

링크: http://www.w3schools.com/jsref/jsref_shift.asp

링크: http://www.w3schools.com/jsref/jsref_pop.asp


shift: 배열의 앞쪽을 리턴하고 배열에서 삭제한다.

pop: 배열의 뒷쪽을 리턴하고 배열에서 삭제한다.

posted by 뚱2

링크: http://bower.io/

링크: http://blog.outsider.ne.kr/933

posted by 뚱2

링크: http://jqueryvalidation.org/documentation/

링크: http://jqueryvalidation.org/validate

'JavaScript > jQuery' 카테고리의 다른 글

[jQuery] jQuery plugin jmp3  (0) 2014.06.25
[jQuery] jQuery form validation  (0) 2014.06.05
[jQuery] jQuery-File-Upload  (0) 2014.05.06
[jQuery] jQuery Form validator  (0) 2013.11.18
[jQuery] jQuery.serializeObject 만들기  (0) 2013.10.15
posted by 뚱2

링크: https://github.com/blueimp/jQuery-File-Upload

문서: https://github.com/blueimp/jQuery-File-Upload/wiki

'JavaScript > jQuery' 카테고리의 다른 글

[jQuery] jQuery form validation  (0) 2014.06.05
[jQuery] jquery-validation document  (0) 2014.05.07
[jQuery] jQuery Form validator  (0) 2013.11.18
[jQuery] jQuery.serializeObject 만들기  (0) 2013.10.15
[jQuery] DataTables (table plug-in)  (0) 2013.01.02
posted by 뚱2

링크: http://knockoutjs.com/index.html

문서: http://knockoutjs.com/documentation/introduction.html

예제: http://knockoutjs.com/examples/

튜토리얼: http://learn.knockoutjs.com/

다운로드: http://knockoutjs.com/downloads/index.html


비기너 튜토리얼: http://www.codeproject.com/Articles/680553/Knockout-js-for-Beginners

'JavaScript > Knockout' 카테고리의 다른 글

[Knockout] knockout-animate  (0) 2014.09.16
[knockout] knockout validation  (0) 2014.07.23
[Knockout] Lazy Loading an Observable Array with Knockout JS  (0) 2014.06.21
posted by 뚱2
링크: http://eternicode.github.io/bootstrap-datepicker/?markup=component&format=&weekStart=&startDate=&endDate=&startView=0&minViewMode=0&todayBtn=false&language=en&orientation=auto&multidate=&multidateSeparator=&keyboardNavigation=on&forceParse=on#sandbox

jquery.ui.datapicker의 i11n(bootstrap-datapicker.kr.js)에서 충돌이 난다.

$.fn.bootstrapDP = $.fn.datepicker.noConflict();


/**

 * Korean translation for bootstrap-datepicker

 * Gu Youn <http://github.com/guyoun>

 */

//;(function($){

//    $.fn.datepicker.dates['kr'] = {

//        days: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일", "일요일"],

//        daysShort: ["일", "월", "화", "수", "목", "금", "토", "일"],

//        daysMin: ["일", "월", "화", "수", "목", "금", "토", "일"],

//        months: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"],

//        monthsShort: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"]

//    };

//}(jQuery));


;(function($){

    $.fn.bootstrapDP.dates['kr'] = {

        days: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일", "일요일"],

        daysShort: ["일", "월", "화", "수", "목", "금", "토", "일"],

        daysMin: ["일", "월", "화", "수", "목", "금", "토", "일"],

        months: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"],

        monthsShort: ["1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"]

    };

}(jQuery));


'JavaScript > Bootstrap' 카테고리의 다른 글

[Bootstrap] bootstrap-live-customizer  (0) 2015.07.28
[Bootstrap] Bootstrap document  (0) 2013.08.26
posted by 뚱2

링크: http://blog.naver.com/jaebum85?Redirect=Log&logNo=110187855361

'JavaScript > CSS' 카테고리의 다른 글

[CSS] Table CSS  (0) 2015.06.25
[CSS] Selector 셀렉터  (0) 2012.08.01
posted by 뚱2
posted by 뚱2

링크: http://youngman.kr/?p=1540



posted by 뚱2

링크: http://www.slideshare.net/doortts/ryan-dahl-nodejs-by-doortts?ref=http://blog.doortts.com/253

posted by 뚱2

http://gozillacj.com/wordpress/jsprocedure/

'JavaScript > JavaScript' 카테고리의 다른 글

[JavaScript] JavaScript Closure & scope  (0) 2014.04.04
[JavaScript] 메소드 후킹 구현하기  (0) 2014.03.31
[JavaScript] jsfiddle  (0) 2014.01.24
[JavaScript] 클로져(Closures)  (0) 2014.01.22
[JavaScript] use strict  (0) 2013.12.25
posted by 뚱2

[JavaScript] jsfiddle

JavaScript/JavaScript 2014. 1. 24. 14:49

링크: http://jsfiddle.net/

자바스크립트를 테스트 할수 있는 환경

posted by 뚱2

링크: https://docs.google.com/presentation/d/1YYv8eYoPpY694xAFvdTY3htoCGaMJlzfCYFthAIQe3U/edit#slide=id.p

링크: https://developer.mozilla.org/ko/docs/JavaScript/Guide/Closures

posted by 뚱2

링크 : https://github.com/rogerwang/node-webkit


이제 자바스크립트로 어플리케이션을 만드는 날이 왔구나.

연구해 봐야겠다.

posted by 뚱2

링크 : https://github.com/visionmedia/ejs

링크 : http://runnable.com/UTlPPF-f2W1TAAEa/render-ejs-with-express


var express = require('express');

var app = express();



// Register ejs as .html. If we did

// not call this, we would need to

// name our views foo.ejs instead

// of foo.html. The __express method

// is simply a function that engines

// use to hook into the Express view

// system by default, so if we want

// to change "foo.ejs" to "foo.html"

// we simply pass _any_ function, in this

// case `ejs.__express`.


app.engine('.html', require('ejs').__express);


// Optional since express defaults to CWD/views


app.set('views', __dirname + '/views');


// Without this you would need to

// supply the extension to res.render()

// ex: res.render('users.html').

app.set('view engine', 'html');


// Dummy users

var users = [

  { name: 'tobi', email: 'tobi@learnboost.com' },

  { name: 'loki', email: 'loki@learnboost.com' },

  { name: 'jane', email: 'jane@learnboost.com' }

];


app.get('/', function(req, res){

  res.render('users', {

    users: users,

    title: "EJS example",

    header: "Some users"

  });

});



app.listen(80);

console.log('Express app started on port %d', 80);


posted by 뚱2

링크 : http://firejune.io/express/guide

posted by 뚱2

링크 : https://github.com/Chevex/UglifyJS2/commit/7348facbe994aa1909a276b4be54f13c7f01e079



IntelliJ IDEA를 사용하고 있는데 Node Module을 만들고 구동했더니


콘솔에 [ReferenceError: Process is not defined] 발생했다.


구글링 모듈 Root의 node_modules 하위의 tools/node.js의 'vm.createContext'을 찾아서 아래의 하이라이팅 부분(4, 5 라인)을 


추가해 준다.


var UglifyJS = vm.createContext({

      sys           : sys,

      console       : console,

      process       : process,

      Buffer        : Buffer,

      MOZ_SourceMap : require("source-map")

});


'JavaScript > NodeJS' 카테고리의 다른 글

[Node.js] Render ejs with express  (0) 2014.01.13
[Node.js] Express - API 가이드 문서  (0) 2014.01.13
[Node.js] Node download  (0) 2014.01.10
[Node.js] Node.js tutorial  (0) 2013.04.23
[Node.js] Node.js 한글 페이지  (0) 2012.02.09
posted by 뚱2

[Node.js] Node download

JavaScript/NodeJS 2014. 1. 10. 10:21

Download : http://nodejs.org/download/

Documentation : http://nodejs.org/api/

posted by 뚱2

[JavaScript] use strict

JavaScript/JavaScript 2013. 12. 25. 21:33

링크 : http://msdn.microsoft.com/ko-kr/library/ie/br230269(v=vs.94).aspx

posted by 뚱2

링크 : http://www.regexper.com/

'JavaScript > JavaScript' 카테고리의 다른 글

[JavaScript] 클로져(Closures)  (0) 2014.01.22
[JavaScript] use strict  (0) 2013.12.25
[JavaScript] JavaScript OOP Tutorial  (0) 2013.12.04
[JavaScript] 자바스크립트 모듈화 require.js  (0) 2013.10.18
[JavaScript] Date Format  (0) 2013.10.15
posted by 뚱2

서버에서 가져온 데이터(DB)를 특별히 가공하지 않고 클라이언트(JavaScript)까지 전달하고 싶을때가 있습니다!!!


사실 항상 그렇습니다. 난 개발자 이고 편하고 싶으니까...


서버 사이트는 SpringFramework + Hibernate 조합으로 개발하고 있는데, Hibernate를 사용하면서 셀렉트를 하면


List<EntityObject> 형태로 데이터셋이 만들어 집니다.


일차원 적인 구조라면 변환후 바로 jqGrid에서 사용이 가능합니다. EntityObject안에 또 컴포지트 오브젝트가 존재하면


그리고 그 오브젝트를 그리드에 표현하고 싶다면 일반적인 jqGrid구조로는 되지 않습니다.


이렇게 이야기 하니까 엄청 거창한것 같은데 예제 코드를 보면 별것 없습니다.


colModel의 sorttype과 formatter를 함수로 만들어 주고 각 상황에 맞게 처리해 주면 됩니다.


// 데이터 구조

var mydata = [

    {id:"1",invdate:"2007-10-01",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"     , test: {name: 'testName1'}},

    {id:"2",invdate:"2007-10-02",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"   , test: {name: 'testName2'}},

    {id:"3",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"   , test: {name: 'testName3'}},

    {id:"4",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"     , test: {name: 'testName4'}},

    {id:"5",invdate:"2007-10-05",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"   , test: {name: 'testName5'}},

    {id:"6",invdate:"2007-09-06",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"   , test: {name: 'testName6'}},

    {id:"7",invdate:"2007-10-04",name:"test",note:"note",amount:"200.00",tax:"10.00",total:"210.00"     , test: {name: 'testName7'}},

    {id:"8",invdate:"2007-10-03",name:"test2",note:"note2",amount:"300.00",tax:"20.00",total:"320.00"   , test: {name: 'testName8'}},

    {id:"9",invdate:"2007-09-01",name:"test3",note:"note3",amount:"400.00",tax:"30.00",total:"430.00"   , test: {name: 'testName9'}}

];


$grid.jqGrid({

    datatype: "local",

    height: 250,

    colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes', 'test'],

    colModel:[

        {name:'id',index:'id', width:60, sorttype:"int"},

        {name:'invdate',index:'invdate', width:90, sorttype:"date"},

        {name:'name',index:'name', width:100},

        {name:'amount',index:'amount', width:80, align:"right",sorttype:"float"},

        {name:'tax',index:'tax', width:80, align:"right",sorttype:"float"},

        {name:'total',index:'total', width:80,align:"right",sorttype:"float"},

        {name:'note',index:'note', width:150, sortable:false},

        {

            name: 'test',

            index: 'test',

            width:150,

            sorttype: function(cell) {

                return cell['name'];

            },

            formatter: function(cellvalue, options, rowObject) {

                return cellvalue['name'];

            }

        }

    ],

    multiselect: true,

    caption: "Manipulating Array Data"

});


for(var i=0;i<=mydata.length;i++)

    $grid.jqGrid('addRowData',i+1,mydata[i]);


'JavaScript > jqGrid' 카테고리의 다른 글

[jqGrid] Homepage and Manual  (0) 2013.11.12
[jqGrid] Grid DataSet 만들기 MultiSelect 포함  (0) 2011.12.19
posted by 뚱2

[Markdown] Markdown syntax

JavaScript/Markdown 2013. 12. 17. 12:17

링크 : http://daringfireball.net/projects/markdown/syntax

'JavaScript > Markdown' 카테고리의 다른 글

[Markdown] GitHub Flavored Markdown  (0) 2014.06.12
posted by 뚱2

링크 : http://jcf.daewoobrenic.co.kr/blog/?p=235

posted by 뚱2

[ParamQuery] pqGrid

JavaScript/ParamQuery 2013. 12. 8. 22:47

링크 : http://paramquery.com/grid

posted by 뚱2

링크 : http://jcf.daewoobrenic.co.kr/blog/?p=237


posted by 뚱2