185、商城业务-检索服务-页面筛选条件渲染

th:href="${'javascript:searchProducts("brandId", '+brand.brandId+')'}"

function searchProducts(name, value){
        //原来的页面
        location.href = location.href + "&" + name + "=" + value;
    }

地址栏地址就会改变

th:href="${'javascript:searchProducts("catalog3Id", '+catalog.catalogId+')'}"

 function searchProducts(name, value){
        //原来的页面
        var href = location.href + "";
        if(href.indexOf("?") != -1){
            location.href = location.href + "&" + name + "=" + value;
        } else {
            location.href = location.href + "?" + name + "=" + value;
        }
    }

 

猜你喜欢

转载自blog.csdn.net/pyd1040201698/article/details/108392183
今日推荐