Authored by 郝肖肖

搜索历史记录 取前十个

... ... @@ -107,7 +107,7 @@ $search.on('touchend', function() {
(function() {
var html = '',
history,
historys, i;
historys, i, num = 1;
if (localStorage) {
historys = localStorage.getItem('historys');
... ... @@ -121,6 +121,10 @@ $search.on('touchend', function() {
continue;
}
if (num++ > 10) {
break;
}
html += '<li><a href="/?query=' + history + '">' + history + '</li>';
}
... ...