如果JSLint抱怨"I"在这种情况下是一个未使用的变量,我该怎么办:
var items = "<option selected></option>";
$.each(data, function (i, item) {
items += "<option value='" + item.Value + "'>" + item.Text + "</option>";
});
(i, item) is the required order of parameters and I'm only using "item".
除了容忍未使用的变量或重写$之外,还有其他解决方案吗.每种方法都要使用索引,这两种方法我都不想做?
提前谢谢.
Update: I appreciate all the suggestions but this code is simply an example to show you what I mean and I'm interested to see a general solution, if there's any. Thanks.