Commit 338ca61c authored by idalin's avatar idalin

fixed douban api not working in some cases

parent f44574af
...@@ -24,17 +24,14 @@ $(document).ready(function () { ...@@ -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 () { ...@@ -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;
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment