$().ready(function() { var articleType = null; articleType = $(".categories .pinka").attr("type"); if (articleType == null || articleType == '' || articleType == undefined) { articleType = ""; } localStorage.setItem("productPage", 1); localStorage.setItem("productType", articleType); initProduct(articleType); }); function initProduct(type) { var url = "/ht/product/all/" + type; $.ajax({ type: 'GET', url: url, async: false, dataType: 'json', timeout: 5000, success: function(result) { if (result.code === 0) { var body = "
"; $.each(result.data, function(fi, fours) { var bodyHtml = ""; $.each(fours, function(ti, product) { var json = JSON.stringify(product); var bodyDiv = "
" + "\"w3pvt\"" + "
" + "
" + product.name + "" + product.description + "
" + "
"; bodyHtml = bodyHtml + bodyDiv; }); bodyHtml = bodyHtml; body = body + bodyHtml; }); body = body+"
"; $("#product_list").html(body); } else { } } }); } function goProductInfo(product) { localStorage.setItem("product", JSON.stringify(product)); window.location.href = "/productinfo.html"; }