'; $(".word_help_history_wrap").html(html); } //添加历史数据 function addHtml2() { if(!localStorage){return false;} // 历史记录存储 var historyWords = localStorage.getItem('historyWords'); historyWords =historyWords?historyWords.split(','):[]; var newWord=searchWord.split('=')[1]; //去除掉【添加新搜索词到历史记录里】 try{ if(historyWords.indexOf(newWord)==-1&≠wWord){ historyWords.unshift(newWord); localStorage.setItem('historyWords',historyWords.join(',')); } }catch(oException){ if(oException.name == 'QuotaExceededError'){ console.log('超出本地存储限额！'); //如果历史信息不重要了，可清空后再设置 historyWords.splice(21); localStorage.setItem('historyWords',historyWords.join(',')); } } //热门搜索关键词初始化(暂时写死) //初始化历史下拉记录 if(historyWords.length==0){ $('.word_help_history_wrap').html(''); }else{ var htmlStr = '