Run jsLint on this fiddle. The script runs, but what is jsLint telling me when it says "Problem at line 7 character 18: Cannot set property 'first' of undefined"?
Update with sample code fiddle:
(function($) {
$.fn.selectBox = function(data) {
for (var x = 0; x < data.length; x++) {
}
return this;
};
})(jQuery);
It's because you're defining the variable for the for
statement inside of it. Declare it outside and solved!. I fixed a few other warnings. http://jsfiddle.net/SXajC/87/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With