본문 바로가기

웹/javascript14

typeof, instanceof typeof "string"// "string" typeof 123// "number" typeof 1.2// "number" typeof 1/0// NaN?? typeof 할때 계산은 미리 하고 진행하자. 이상하다. typeof (1/0)// "number"?? typeof 0/1// NaN?? typeof (0/1)// "number"?? 1/0// Infinity typeof Infinity// "number" typeof false// "boolean" typeof afssddfd// "undefined" typeof null// "object"!!! typeof []// "object" typeof new Array("12")// "object" typeof {}// "object" typeof.. 2018. 5. 20.
setTimeout 과 this function fn1(){ console.log("this is window: " + this); } var obj2 = { name : "obj2Name" , age : 21 , fn2 : function(){ console.log("this is obj2: " + this); } , fn3 : function(){ this.age = this.age + 2; console.log("this is 5 " + this); console.log("obj2.age 5==" + obj2.age); } , fn4 : function(){ // 정상 console.log("this is obj2: " + this); this.age = this.age + 1; console.log("obj2.age==" + o.. 2018. 5. 19.
css display : block 과 inline, ( inline-block 은 div에 float:left를 더한 효과 ) block : p, divinline : a, span inline방식은 width, height 적용되지 않는다. (display:block으로 변경해야 한다.)width란 border를 제외한 content의 실제 크기이다.> box-sizing:content-box// 전체 크기(width등)를 border 제외해서 계산> box-sizing:border-box // 전체 크기(width등)를 border 포함해서 계산 -> 계산하기 편함.> *{box-sizing:border-box}>> *{ } 전체선택자는 성능 이슈가 있다. font, color 속성은 하위에 상속된다. 마.. 2018. 5. 2.
Browsersync, VSCode, Brackets Browsersync프로젝트 내의 static 파일 저장시, 변경사항을 감지해서, 자동으로 브라우저를 reload해준다.여러개 가능(크로스 브라우징 체크시 유용할 듯) 설치(시간이 좀 걸린다.)cmd> npm install -g browser-sync 해당 프로젝트 root로 이동해서cmd> browser-sync start --server --files "*" * Nojde.js, react, Play Framework 등으로 서버를 구성해도, 소스 변경사항을 실시간으로 변경해주지만.Browsersync는 별다른 설정이 필요없다는 장점! 출처: https://www.browsersync.io VSCode세팅 순서 Ctrl+P : 파일찾기 Ctrl+Shift+P : 세팅찾기(파일찾기앞에 > 추가한 것과 .. 2018. 5. 1.
svg to png svg -> canvas -> img -> a href function btn_image(){var svg = $("#chart1 svg")[0];var svgData = new XMLSerializer().serializeToString(svg);var canvas = document.createElement("canvas");var svgSize = svg.getBoundingClientRect(); canvas.width = svgSize.width; canvas.height = svgSize.height; var ctx = canvas.getContext("2d"); var img = document.createElement("img");img.setAttribute("src", "data:ima.. 2017. 11. 15.
텍스트 자동 변환1 R을 이용한 데이터처리 분석 실무https://thebook.io/006723/ 의 데이터 가공 > R script만 가져오기 2016. 10. 2.