jQuery 의 prototype 과 fn 은 어떤 용도로 사용되는가?
jQuery 1.2.6 코드를 살펴보면, 아래와 같은 부분이 있다. jQuery.fn = jQuery.prototype = { init: function( selector, context ) { // Make sure that a selection was provided selector = selector || document; .......... }, }; 이 코드에 나와있는 prototype 과 fn 이, jQuery 에서 하는 역할을 살펴보고자 한다. 모든 object 는 prototype 이라는 속성을 가지고 있다.이것은 단순히 다른 오브젝트들이 상속받을 수 있는 속성이라고 보면 된다. function Person(name) { this.name = name; } Person.prototype.s..
IT공부방/jQuery, ajax, java
2016. 7. 19. 13:41