티스토리 뷰

from : http://paulirish.com/2011/11-more-things-i-learned-from-the-jquery-source/
jQuery Anti-Patterns for Performance presentation file: http://paulirish.com/2009/perf/

jQuery 에 대한 얘기를 해준다.
기억나는 것은 selector 를 이용한 traversing 은 성능이 좋지 않다. 라는 이야기.
그리고 jQuery library 를 black box 처럼 사용하지 말고, 그안의 code 를 파악하고 사용하라는 이야기.
최신 jQuery source : http://bit.ly/jqsource

아래는 video 에서 얘기하는 내용 몇가지를 적어놨다.
jQuery 에 관심이 있다면 한 번 보면 유용할 듯 하다.

////////////////////////////////////////////////////////////////////////////////////////
----------------------------------------------
(function(){
})()

(function(window, document, undefined){

})(this, this.document)
----------------------------------------------
using
	(function func_name(){
doStuff(); setTimeout(func_name, 100);
})()
instead of
	setInterval(function(){
	  doStuff();
	}, 100);
----------------------------------------------
jQuery.noConflict()

http://okjungsoo.tistory.com/entry/jQuery%EC%99%80-%EB%8B%A4%EB%A5%B8-%EB%9D%BC%EC%9D%B4%EB%B8%8C%EB%9F%AC%EB%A6%AC%EB%A5%BC-%ED%95%A8%EA%BB%98-%EC%82%AC%EC%9A%A9%ED%95%98%EA%B8%B0
for the library which uses the $,
turn the $ back to the statue with origin value.
----------------------------------------------
to add the property
	jQuery.props
		jQuery.props['test'] = 'testtest';
		jQuery(elem).attr('test')
----------------------------------------------
to add or change the spped of jQuery(elem).fadeIn() speed.
	$(elem).fadeIn('normal');
	jQuery.fx.sppeds.blah = 100;

----------------------------------------------
jQuery.getScript()
--> make own getScript() to make fast and simple using jQuery.getScript().

댓글