
Sly는 Harald Kirschner씨에 의해 만들어진 최신 DOM 선택자 엔진입니다. 고작 3kb크기(minified and gzipped)의 스텐드얼론(독립형)으로 실행되는 이 선택자 엔진은 위 차트(slickspeed 테스트 결과) 에서 알 수 있듯이 성능이 매우 탁월합니다. 최신 브라우저들이 지원하는 기능을 셀렉터에 최적화하고 강력한 자바스크립트 일치 알고리즘으로 신속하고 정확한 검색이 가능하며, 필터링을 위한 유틸리티 메서드도 제공합니다. 코드는 MooTools의 철학을 따랐으며, 엄격한 표준을 준수한다고 하네요.
// Finds all odd rows in all tables
var rows = Sly.search('table td:odd');
// Finds all links with class "internal" and an attribute "href" starting with "#".
var links = Sly.search('a.internal[href^="#"]');
// Another notation is also possible, since Sly acts as a constructor
var snippets = Sly('pre.highlight.javascript > code').search();
// features is just one element, lists has all list items are siblings of features
var features = Sly.find('#features');
var lists = Sly.search('~ ul', body);
Comments