var jQuery = function(selector) {
return new jQuery.fn.init(selector);
};
jQuery.fn = jQuery.prototype = {...};
var init = jQuery.fn.init = function(selector){
this.selector = selector;
this.element = document.querySelector(this.selector);
};
console.log(
jQuery('div').selector
);
Ich bin derzeit untersuchen, wie jQuery funktioniert, aber ich habe einige Fragenerstellen Bibliothek wie jQuery Stil
jQuery.fn = jQuery.prototype = {};
warumprototype = object
, ist nicht in der Regel mit dem Namen Prototyp kommen nachjQuery.prototype.foo = function...
var init = jQuery.fn.init (jQuery.prototoype.init)
Wenn ichvar init
entferne, habe ich einen Fehler, so:var jQuery.fn.init = ...
ist jQuery.fn.init = jQuery.prototype.init? bezieht sich das auf jQuery.prototype = {} object? –