0
以下ajax函數在jquery 1.4.4中工作,但不在1.5中。我仍然沒有完全掌握$ .ajax 1.5的新功能。我轉過身來快速回答。什麼需要改變。
function ReceiveAndShowResults(query) {
var bingUri = BuildBingApiUri(query, offset);
$.ajax({
url: bingUri,
success: OnResultsReceived,
error: OnError,
dataType: 'jsonp'
});
}
function BuildBingApiUri(query, offset) {
var bingApiUrl = "http://domain.com/json.aspx";
var bingApiAppId = "12345";
var bingApiImageCount = "25";
var s = bingApiUrl + "?AppId=" + bingApiAppId + "&Sources=image&" + "&Query=" + query + "&Image.Count=" + bingApiImageCount + "&Image.Offset=" + offset + "&JsonType=callback&JsonCallback=?";
return s;
}
功能ReceiveAndShowResults(查詢,??) – Rafay 2011-02-02 08:19:26