jquery 判断数据是否重复

$.each(colorlist, function (index) {
                    var bnum = 0;
                    $.each(colorlist, function (index2) {
                        if (colorlist[index] == colorlist[index2]) { bnum += 1; }
                    })
                    if (bnum > 1) { alert("存在重复的颜色!请核查"); return false; }
                })

  

编辑器加载中...

posted @ 2011-12-11 17:17  杯具的小北  阅读(1058)  评论(0编辑  收藏  举报