From 162dddea2277beb07aa2733b10b6a5d7bdd58a85 Mon Sep 17 00:00:00 2001 From: "mail_yanpeng@163.com" Date: Wed, 14 Aug 2019 11:02:14 +0800 Subject: [PATCH] =?UTF-8?q?es=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- views/search.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/views/search.html b/views/search.html index acf8f48..ddee2cd 100644 --- a/views/search.html +++ b/views/search.html @@ -59,8 +59,8 @@ //请求前的处理 }, success: function (resp) { + $(".search-result").children().remove(); if (resp.hits.total != 0) { - $(".search-result").children().remove(); resp.hits.hits.forEach(function (el, index) { console.log(el._source) var htmlStr = '
\n' + @@ -69,6 +69,8 @@ '
' $(".search-result").append(htmlStr) }) + }else{ + $(".search-result").append('

没有搜索到相关文章

') } //请求成功时处理 },