1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-11-24 10:37:23 +00:00

fixed douban api not working in some cases

This commit is contained in:
idalin 2017-02-28 15:17:37 +08:00
parent f44574af67
commit 338ca61cf9

View File

@ -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;
},