這樣一個(gè)數(shù)組(curFiles)改如何模糊篩選里面的圖片名字,并在前端頁(yè)面展示模糊搜索出來(lái)的圖片我的代碼如下:$(function(opposedid){$('#search_btn').click(function() {var searchText = $.trim($('#search_con').val().toString());if (searchText !== '') {for (i = 0;i < curFiles.length;i ++ ){if(curFiles[i].indexOf(searchText) >= 0 ){console.log(curFiles[i]);showImages(curFiles[i],opposedid);}} } else {
showImages(curFiles,opposedid);
return false;
}
})});搜索完后展示的卻是這樣:我該如何寫才是正確的
前端JS模糊搜索功能問(wèn)題
幕布斯7119047
2018-07-24 13:18:14