From 37b977c2c5eb601af31077c4067f72617645b6af Mon Sep 17 00:00:00 2001 From: Rhilip Date: Thu, 1 Dec 2022 21:39:14 +0800 Subject: [PATCH] =?UTF-8?q?pref:=20=E4=BC=98=E5=8C=96=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E6=97=B6=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index a6ae13c..06f5891 100644 --- a/index.html +++ b/index.html @@ -190,16 +190,21 @@

相关替代

baseParams.source = $('#search_source_val').val(); $.getJSON('/', baseParams) .success(function (data) { - let subjects = data.data; - gen_help.html(subjects.reduce((accumulator, currentValue) => { - return accumulator += "" + currentValue.year + "" + currentValue.subtype + "" + currentValue.title + (currentValue.subtitle && currentValue.subtitle !== currentValue.title ? ('
' + currentValue.subtitle) : '') + "" + currentValue.link + "选择"; - }, "")); - $("a.gen-search-choose").click(function () { - let tag = $(this); - input_btn.val(tag.attr("data-url")); - search_source.hideBtn(); - query_btn.click(); - }); + if (data["success"] === false) { + alert(data["error"]); + } else { + let subjects = data.data; + gen_help.html(subjects.reduce((accumulator, currentValue) => { + return accumulator += ""; + }, "
年代类别标题资源链接行为
" + currentValue.year + "" + currentValue.subtype + "" + currentValue.title + (currentValue.subtitle && currentValue.subtitle !== currentValue.title ? ('
' + currentValue.subtitle) : '') + "
" + currentValue.link + "选择
")); + $("a.gen-search-choose").click(function () { + let tag = $(this); + input_btn.val(tag.attr("data-url")); + search_source.hideBtn(); + query_btn.click(); + }); + } + }) .fail(failedFunc) .complete(completeFunc);
年代类别标题资源链接行为