fixed douban api not working in some cases
This commit is contained in:
parent
f44574af67
commit
338ca61cf9
|
@ -24,17 +24,14 @@ $(document).ready(function () {
|
||||||
return this.replace(new RegExp(s1, "gm"), s2);
|
return this.replace(new RegExp(s1, "gm"), s2);
|
||||||
}
|
}
|
||||||
|
|
||||||
$.ajaxSetup({
|
|
||||||
type: "GET",
|
|
||||||
dataType: "jsonp",
|
|
||||||
jsonp: 'callback',
|
|
||||||
});
|
|
||||||
|
|
||||||
gg_search_book = function (title) {
|
gg_search_book = function (title) {
|
||||||
title = title.replaceAll(/\s+/, '+');
|
title = title.replaceAll(/\s+/, '+');
|
||||||
var url = google + gg_search + '?q=' + title;
|
var url = google + gg_search + '?q=' + title;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
|
type: "GET",
|
||||||
|
dataType: "jsonp",
|
||||||
|
jsonp: 'callback',
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
gg_results = data.items;
|
gg_results = data.items;
|
||||||
},
|
},
|
||||||
|
@ -89,6 +86,9 @@ $(document).ready(function () {
|
||||||
var url = douban + db_search + '?q=' + title + '&fields=all&count=10';
|
var url = douban + db_search + '?q=' + title + '&fields=all&count=10';
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
|
type: "GET",
|
||||||
|
dataType: "jsonp",
|
||||||
|
jsonp: 'callback',
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
db_results = data.books;
|
db_results = data.books;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user