Mistři v programování na #hovnokod

JavaScript #3832

var var val val val?

self.paramItems.each(function (k, v) {
            var val = $(v);
            var isIndexed = val.attr('data-indexed') == "1";
            var item;

            if (val.is(':checkbox') && val.prop('checked')) {
                item = includeIndexed && isIndexed ? val.attr('data-sef') : val.attr('name') + '=' + val.val();
            } else if (val.is('select')) {
                var selected = val.find('option:selected');
                if (selected.length === 1 && selected.val() && selected.val() != "0") {
                    item = isIndexed ? val.attr('data-sef') : val.attr('name') + '=' + selected.val();
                }
            } else if (val.is(':text')) {
                if (val.val() && val.val() !== '' && val.val() != "od" && val.val() != "do") {
                    item = val.attr('name') + '=' + val.val();
                }
            }

            if (item) {
                if (isIndexed && includeIndexed) {
                    indexed.push(item);
                } else {
                    items.push(item);
                }
            }

        });

Anonymous,