From 338ca61cf912e06e216485da51254a40b420608f Mon Sep 17 00:00:00 2001 From: idalin Date: Tue, 28 Feb 2017 15:17:37 +0800 Subject: [PATCH] fixed douban api not working in some cases --- cps/static/js/get_meta.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cps/static/js/get_meta.js b/cps/static/js/get_meta.js index 59b5523c..f2b8fda3 100644 --- a/cps/static/js/get_meta.js +++ b/cps/static/js/get_meta.js @@ -24,17 +24,14 @@ $(document).ready(function () { return this.replace(new RegExp(s1, "gm"), s2);   } - $.ajaxSetup({ - type: "GET", - dataType: "jsonp", - jsonp: 'callback', - }); - gg_search_book = function (title) { title = title.replaceAll(/\s+/, '+'); var url = google + gg_search + '?q=' + title; $.ajax({ url: url, + type: "GET", + dataType: "jsonp", + jsonp: 'callback', success: function (data) { gg_results = data.items; }, @@ -89,6 +86,9 @@ $(document).ready(function () { var url = douban + db_search + '?q=' + title + '&fields=all&count=10'; $.ajax({ url: url, + type: "GET", + dataType: "jsonp", + jsonp: 'callback', success: function (data) { db_results = data.books; },