걍 새로운 배열로 바꿔치기 하는게 최고인듯 (메모리 누수는 안일어 나려나?)

 

testArray = [];

[링크 : http://jsben.ch/hyj65]

   [링크 : https://stackoverflow.com/questions/1232040/how-do-i-empty-an-array-in-javascript]

'Programming > javascript & HTML' 카테고리의 다른 글

closure  (0) 2019.04.24
iife (Immediately Invoked Function Expression)  (0) 2019.04.23
js 난독화  (0) 2019.03.14
HTML video 태그 loop 와 webalizer hit  (0) 2019.02.28
자바 스크립트 다시 공부 - 이벤트 관련  (0) 2019.02.28
Posted by 구차니

패킹 혹은 난독화라고 해야 하려나?

패킹은 단순하게 base62로 인코딩 한 것을 eval을 통해서 실행하는 구조인 거라

난독화라 하긴 애매한 녀석이고


짧은 녀석을 패킹하니 오히려 더 데이터가 많아지는 현상이 발생!

var aasdfasdf = 'asdfasfasdf';

console.log("aasdfasdf :"+aasdfasdf); 


대충봐도 어떤 구조인지 그냥 눈에 보이는 느낌적인 느낌?

eval(function(p,a,c,k,e,r){e=String;if(!''.replace(/^/,String)){while(c--)r[c]=k[c]||c;k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('1 0=\'2\';3.4("0 :"+0);',5,5,'aasdfasdf|var|asdfasfasdf|console|log'.split('|'),0,{})) 


[링크 : https://fimtrus.tistory.com/entry/자바스크립트-난독화패킹-언패킹]

  [링크 : http://dean.edwards.name/packer/]

  [링크 : https://www.strictly-software.com/unpacker#unpacker]

[링크 : https://xetown.com/questions/494426]

[링크 : https://12bme.tistory.com/357]


한 10만원 하는 프로그램이 쩐다고(압축율에서)

[링크 : https://allroundplaying.tistory.com/59]


[링크 : https://obfuscator.io/] 얜 무료


원리관련

[링크 : https://4rgos.tistory.com/2]

Posted by 구차니

webalizer를 보다보니..

이 태그는 재생이 끝나면 또 다시 서버에 요청해서 비디오를 다운로드 받아서 또 재생한다.

그냥 브라우저의 캐시에 저장된걸 다시 재생하는 줄 알았는데


트래픽 문제가 있거나 모바일일 경우에는 video loop에 대해서는 고민을 좀 해봐야 할 듯..

[링크 : https://www.w3schools.com/tags/att_video_loop.asp]

'Programming > javascript & HTML' 카테고리의 다른 글

javascript 배열 초기화(벤치마크)  (0) 2019.04.12
js 난독화  (0) 2019.03.14
자바 스크립트 다시 공부 - 이벤트 관련  (0) 2019.02.28
js import babel transpiler  (0) 2019.01.10
js class extend  (0) 2019.01.10
Posted by 구차니

'Programming > javascript & HTML' 카테고리의 다른 글

js 난독화  (0) 2019.03.14
HTML video 태그 loop 와 webalizer hit  (0) 2019.02.28
js import babel transpiler  (0) 2019.01.10
js class extend  (0) 2019.01.10
img vertical-align  (0) 2018.12.28
Posted by 구차니

자바 스크립트 문법이 아니라 자바 문법인줄 알았는데

js에도 import나 class나 extend가 있을 줄이야..


아무튼 찾아보니 ES5랑 ES6 에서 지원하는게 다르다 보니

ES5에 ES6을 지원하기 위해서라도 Typescript 등과 같은 변환용 무언가가 필요한 듯?

[링크 : https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Statements/import]

[링크 : https://jeong-pro.tistory.com/122]


소스를 다른 소스로 변경하는 녀석들을 이렇게 표현하는 듯

 A source-to-source compiler, transcompiler or transpiler

[링크 : https://en.wikipedia.org/wiki/Source-to-source_compiler]

'Programming > javascript & HTML' 카테고리의 다른 글

HTML video 태그 loop 와 webalizer hit  (0) 2019.02.28
자바 스크립트 다시 공부 - 이벤트 관련  (0) 2019.02.28
js class extend  (0) 2019.01.10
img vertical-align  (0) 2018.12.28
css text-indent  (0) 2018.12.28
Posted by 구차니

'Programming > javascript & HTML' 카테고리의 다른 글

자바 스크립트 다시 공부 - 이벤트 관련  (0) 2019.02.28
js import babel transpiler  (0) 2019.01.10
img vertical-align  (0) 2018.12.28
css text-indent  (0) 2018.12.28
localstorage sessionStorage  (0) 2018.12.18
Posted by 구차니

'Programming > javascript & HTML' 카테고리의 다른 글

js import babel transpiler  (0) 2019.01.10
js class extend  (0) 2019.01.10
css text-indent  (0) 2018.12.28
localstorage sessionStorage  (0) 2018.12.18
ajax success 콜백 사용하기  (0) 2018.12.15
Posted by 구차니

padding으로 하면 크기가 달라져서 귀찮았는데

딱 내가 바라던 용도의 태그..


(그러니까 들여쓰기)

[링크 : https://www.codingfactory.net/10459]

'Programming > javascript & HTML' 카테고리의 다른 글

js class extend  (0) 2019.01.10
img vertical-align  (0) 2018.12.28
localstorage sessionStorage  (0) 2018.12.18
ajax success 콜백 사용하기  (0) 2018.12.15
js __proto__  (0) 2018.12.14
Posted by 구차니


웹 스트로지 생명주기와 범위

로컬 스토리지와 세션 스토리지는 저장된 데이터의 생명주기와 범위에 차이가 있다. 로컬 스토리지를 통해 저장된 데이터는 만료기한이 없고, 웹 애플리케이션이 삭제되기 전이나 사용자가 브라우저의 특정 인터페이스를 통해 삭제하기전까지는 사용자의 컴퓨터에 존재하므로 영구적으로 저장된다고 할 수 있다.

[링크 : http://iamawebdeveloper.tistory.com/97]


+

localstorage 저장, 읽기는

setItem()

getItem()을 통해 이루어지고

크롬에서 항목이 없을시 null을 리턴한다.

[링크 : https://stackoverflow.com/questions/2010892/storing-objects-in-html5-localstorage]


+

2018.12.26

삭제시에는 removeitem()을 이용한다.

[링크 : https://developer.mozilla.org/ko/docs/Web/API/Storage/removeItem]

'Programming > javascript & HTML' 카테고리의 다른 글

img vertical-align  (0) 2018.12.28
css text-indent  (0) 2018.12.28
ajax success 콜백 사용하기  (0) 2018.12.15
js __proto__  (0) 2018.12.14
canvas dataURL to Formdata(file)  (0) 2018.12.07
Posted by 구차니

ajax 콜 할때 success에 콜백함수를 쓰는게 아니라

직접 특정 함수로 바로 넘기는 것도 가능하네?

어떻게 보면 당연한건데 왜 생각을 못했을까.. -ㅁ-


$.ajax({

    url: HOME_PATH +'/data/earthquake_weight.json',

    dataType: 'json',

    success: startDotMap

});


function startDotMap(data) {

    var dotmap = new naver.maps.visualization.DotMap({

        map: map,

        data: data.coordinates,

        radius: 20

    });

}

[링크 : https://navermaps.github.io/maps.js/docs/tutorial-5-visualization-dotmap-w.example.html]

'Programming > javascript & HTML' 카테고리의 다른 글

css text-indent  (0) 2018.12.28
localstorage sessionStorage  (0) 2018.12.18
js __proto__  (0) 2018.12.14
canvas dataURL to Formdata(file)  (0) 2018.12.07
js 부모창 변수 접근하기  (0) 2018.12.04
Posted by 구차니