87,919
社区成员
发帖
与我相关
我的任务
分享
// @grant GM_xmlhttpRequest
GM_xmlhttpRequest ( {
method : "get",
url : "https://api.douban.com/v2/book/isbn/" + isbn,
onload : function (result) {
var bookInfo = JSON.parse ( result.responseText );
getBookPrice ( bookInfo );
},
onerror : function (result) {
log ( "-Error:获取书籍信息失败" );
}
function callback(d) {
alert(d.query.results.json.rating.average)///
}
function callback(d) {
alert(JSON.stringify(d))
}
function LoadDataByYQL(url) {
var s = document.createElement('script');
s.charset='utf-8'
s.src = 'http://query.yahooapis.com/v1/public/yql?callback=callback&q=select+*+from+json+where+url%3D%22' + encodeURIComponent(url) + '%22&format=json'
document.getElementsByTagName('head')[0].appendChild(s)
}
LoadDataByYQL('https://api.douban.com/v2/book/1220562')