Showing
4 changed files
with
7 additions
and
9 deletions
@@ -659,8 +659,9 @@ function bindWirteLocal($brandList, list) { | @@ -659,8 +659,9 @@ function bindWirteLocal($brandList, list) { | ||
659 | } | 659 | } |
660 | 660 | ||
661 | if (localStorage) { | 661 | if (localStorage) { |
662 | - | ||
663 | - historys = localStorage.getItem('historys-brand'); | 662 | + if (isLocalStorageSupported) { |
663 | + historys = localStorage.getItem('historys-brand'); | ||
664 | + } | ||
664 | 665 | ||
665 | historys = historys ? historys : ''; | 666 | historys = historys ? historys : ''; |
666 | 667 | ||
@@ -749,15 +750,11 @@ function searchResult() { | @@ -749,15 +750,11 @@ function searchResult() { | ||
749 | // 插入 dom,绑定事件 | 750 | // 插入 dom,绑定事件 |
750 | $('.search-result').html(html); | 751 | $('.search-result').html(html); |
751 | changeBackground(); | 752 | changeBackground(); |
752 | - | ||
753 | - if (isLocalStorageSupported) { | ||
754 | - bindWirteLocal($('.brand-list'), true); | ||
755 | - } | 753 | + bindWirteLocal($('.brand-list'), true); |
756 | } | 754 | } |
757 | 755 | ||
758 | loading.showLoadingMask(); | 756 | loading.showLoadingMask(); |
759 | 757 | ||
760 | - | ||
761 | lazyLoad($('img.lazy')); | 758 | lazyLoad($('img.lazy')); |
762 | $('.yoho-header').css({ | 759 | $('.yoho-header').css({ |
763 | 'z-index': 2, | 760 | 'z-index': 2, |
@@ -988,7 +985,9 @@ if ($('.brand-search-page').length > 0) { | @@ -988,7 +985,9 @@ if ($('.brand-search-page').length > 0) { | ||
988 | 985 | ||
989 | 986 | ||
990 | if (localStorage) { | 987 | if (localStorage) { |
991 | - historys = localStorage.getItem('historys-brand'); | 988 | + if (isLocalStorageSupported) { |
989 | + historys = localStorage.getItem('historys-brand'); | ||
990 | + } | ||
992 | 991 | ||
993 | if (historys && historys.length > 0) { | 992 | if (historys && historys.length > 0) { |
994 | historys = historys.split(ranToken); | 993 | historys = historys.split(ranToken); |
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
@@ -241,7 +241,6 @@ function searchResult() { | @@ -241,7 +241,6 @@ function searchResult() { | ||
241 | // 插入 dom,绑定事件 | 241 | // 插入 dom,绑定事件 |
242 | $('.search-result').html(html); | 242 | $('.search-result').html(html); |
243 | changeBackground(); | 243 | changeBackground(); |
244 | - | ||
245 | bindWirteLocal($('.brand-list'), true); | 244 | bindWirteLocal($('.brand-list'), true); |
246 | } | 245 | } |
247 | 246 |
-
Please register or login to post a comment