Aşağıdaki jQuery kodu JSLint uyumlu hale getirmeye çalışıyorum.JSLint - 'jQuery' bildirilmemiş 'uyarı' uyarısı
(function ($) {
"use strict";
$('.addition').click(function() {
$('.textbox:last,.addition:last,.subtraction:last,.replace:last').clone(true).appendTo('.replace:last');
$('.textbox:last').val("");
$('.addition:not(:last),.subtraction:not(:last)').attr('disabled','true');
});
$('.subtraction').click(function() {
if($('.replace').length === 1) {
$('.subtraction').click(function (event) {
event.preventDefault();
});
} else {
$('.textbox:last,.addition:last,.subtraction:last,.replace:last').remove();
$('.addition:last,.subtraction:last').removeAttr('disabled');
}
});
}(jQuery));
Kodum düzgün çalışıyor. Sadece JSLint uyarılarını temizlemeye çalışıyorum. JSLint'in neden }(jQuery));
hattında (son satır) undeclared 'jQuery'
uyarısı verdiğini anlamıyorum. Küresel bir değişken uyarı temizlenmiş olduğu gibi jQuery bildirme
GÜNCELLEME
. Eğer jslint.com kullanıyorsanız
olası yinelenen JQuery üzerinde?] (http://stackoverflow.com/questions/3920012/how-can-i-use-jslint-for-a-segment-of-code-which-depends-on-jquery) –