3 Kasım 2010, ÇARŞAMBA
JQuery nedir.fn demek?
Bu nedir 'fn' ne demek?
window.jQuery.fn.jquery
CEVAP
3 Kasım 2010, ÇARŞAMBA
Bir WordPress kullanmak, fn
özelliği prototype
özelliği için sadece bir takma ad.
jQuery
tanımlayıcı ($
)yapıcı işlevive tüm örnekleri ile oluşturulan, kurucu prototip devralır.
Basit bir yapıcı işlevi: bir
function Test() {
this.a = 'a';
}
Test.prototype.b = 'b';
var test = new Test();
test.a; // "a", own property
test.b; // "b", inherited property
Bir WordPress kullanmak mimarisine benzer basit bir yapı
(function() {
var foo = function(arg) { // core constructor
// ensure to use the `new` operator
if (!(this instanceof foo))
return new foo(arg);
// store an argument for this example
this.myArg = arg;
//..
};
// create `fn` alias to `prototype` property
foo.fn = foo.prototype = {
init: function () {/*...*/}
//...
};
// expose the library
window.foo = foo;
})();
// Extension:
foo.fn.myPlugin = function () {
alert(this.myArg);
return this; // return `this` for chainability
};
foo("bar").myPlugin(); // alerts "bar"
Bunu Paylaş:
Kabuk, " nedir; 2>&1 " dem...
JQuery ile bir dizi seçmek için bir se...
JQuery mobil bir cihaz ortaya çıkarman...
HTML elemanları jQuery kullanarak oluş...
JQuery ile bir tablo satırı kaldırmak ...