Authored by ccbikai

搜索历史记录优化

@@ -175,8 +175,7 @@ if ($('.brand-search-page').length) { @@ -175,8 +175,7 @@ if ($('.brand-search-page').length) {
175 $('form.search-box').on('submit', function() { 175 $('form.search-box').on('submit', function() {
176 return false; 176 return false;
177 }); 177 });
178 - if (localStorage) {  
179 - 178 + if (localStorage && localStorage.getItem('yohoHistory')) {
180 yohoHistory = $.parseJSON('[' + localStorage.getItem('yohoHistory') + ']'); 179 yohoHistory = $.parseJSON('[' + localStorage.getItem('yohoHistory') + ']');
181 if (yohoHistory) { 180 if (yohoHistory) {
182 $.each(yohoHistory, function(index, content) { 181 $.each(yohoHistory, function(index, content) {