高階搜尋在組裝status的時候,程式設計師手抖多了一個+號。
$("#search").click(function(){ var url = $(this).attr('url'); var status = $("#sch-sort-txt").attr("data"); var query = $('.search-form').find('input').serialize(); query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,''); query = query.replace(/^&/g,''); if(status != ''){ query += 'status=' + status + "&" + query; } if( url.indexOf('?')>0 ){ url += '&' + query; }else{ url += '?' + query; } window.location.href = url; });
query += 'status=' + status + "&" + query;這一行應該改成
query = 'status=' + status + "&" + query;