코드 검수 도구
Understand
http://scitools.com
다양한 언어 지원
NDepend
http://www.ndepend.com
.NET 전용
Game of Thrones Daily

gracie abrams

oozey mess
sheepfilms

No title available
untitled
The Stonewall Inn

izzy's playlists!

❣ Chile in a Photography ❣
h
he wasn't even looking at me and he found me
Claire Keane

#extradirty
art blog(derogatory)
EXPECTATIONS
d e v o n
let's talk about Bridgerton tea, my ask is open
cherry valley forever
Lint Roller? I Barely Know Her
Stranger Things
seen from Iraq
seen from United Kingdom
seen from United Kingdom
seen from Mexico
seen from United States

seen from United States
seen from United States
seen from United States
seen from United States
seen from United States
seen from United States

seen from United States
seen from United States
seen from United States
seen from Bangladesh

seen from United States

seen from Spain
seen from Canada

seen from Israel

seen from United States
@bbugguj
코드 검수 도구
Understand
http://scitools.com
다양한 언어 지원
NDepend
http://www.ndepend.com
.NET 전용
C# 은근히 유용한 Collection들
자주 사용하지는 않지만, 그래서 더 잘 안쓰게 되지만, 알아두면 은근히 유용한 Colletion들..
KeyedCollection<TKey, TValue> ReadonlyCollection<T> LinkedList<T> SortedList<T> Stack<T> Queue<T>
Cross Domain 처리 방법
같은 도메인 그룹 내에 있는 싸이트 간의 cross domain
community.my.com 싸이트와 auth.my.com이라는 싸이트 간에 서로 자유롭게 접근이 되어야 하는 경우 아래와 같이 document.domain을 통해 domain 설정
document.domain = "my.com";
전혀 다른 싸이트간의 cross domain
jsonp : get 방식의 처리 경우에 유효한 방법
postMessage : event 처리 방식
참고: https://developer.mozilla.org/en-US/docs/Web/API/window.postMessage
JQuery 의 성능 향상을 위한 Guide
Naming Rule
Jquery Object 의 경우 변수 모호성을 명확하게 하기 위해 변수명 앞에 "$ + 변수명" 으로 처리 한다.
// Bad case Before Code var name = $("#Name"); // Good case var $name = $("#Name"); var name = $("#Name").val();
Selecter
범위를 한정할수록 JQuery Selecter의 성능이 향상된다.
// class 검색시 임의의 class btn 을 찾는다. var active = $(".Active") // 이 경우 모든 항목에서 Active class 를 찾아서 결과를 return 한다. // 개선된 방법 var active = $("li.Active"); // 이 경우 li tag 항목중 Active class 를 찾아준다.
JQuery 하위 검색을 할때는
<body> <ul id="menu"> <li> <input type="text"> </input> <div> </div> </li> </ul> <script> $(function(){ var menu = $("$menu"); // 검색 범위를 한정하고 menu 범위에서 하위를 검색 var input = menu.find("li"); // 명시적인 접근으로 성능을 더 향상 시킨다. var input = menu.find("li div"); }) </script> </body>
Selecter Set Value
한 객체의 연속적인 값을 설정할때의 주의 사항
// Bad case Before Code $("#spnVendorName").attr("readonly", true); $("#spnVendorName").css("cursor", "default"); $("#spnVendorName").css("color", "black"); // Good case After Code $("#spnVendorName").attr("readonly", true) .css("cursor", "default") .css("color", "black");
한 객체의 하위 Child 에 대한 접근을 할 경우 처리 방법
// Bad case Before Code $("#spnTable").find(".selected").attr("readonly" , true); $("#spnTable").find(".nonselected").attr("readonly" , false); // Good case After Code $("#spnTable").find(".selected").attr("readonly" , true).end() .find(".nonselected").attr("readonly" , false);
end Method는 최초 object 를 return 한다
Form Serialize
Form 에 속한 input 접근시 해당 Form 에 대한 값에 대해 serialize()를 통해 json 포맷의 값을 얻을 수 있다.
// "Form" 안의 값을 Ajax parameter 등으로 사용할때에는 serialize() 를 활용한다. var str = $("#form").serialize(); // Javascript Array 형식으로 Form의 용을 serialize 하는방법 var arrayObj = $("#form").serializeArray(); <form id="form"> <input id="name" type="text" /> </form>
참고 - http://api.jquery.com/serialize/ - http://api.jquery.com/serializeArray/
Loop
$.each 나 for문 작성시 loop 문 안에서 $(".menu") 라든지 selector 는 하지 않는다. selector 안에서도 loop가 동작하게 되어 성능을 저하 시킨다.
var catType = ['Tiger' , 'Lion' , 'Cat']; var content; $.each(catType , function() { var text = this; // 배열의 각각 항목 content += "<li>" + this + "</li>"; } );
Event
$("btnSearch").onclick 을 사용하지 않는다. onclick 이 아닌 on 을 사용한다.
// bad case $("btnSearch").onclick(function () {}); //good case $("btnSearch").on("click" , function (){} );