AJAX - The Complete Reference

(avery) #1

PART III


Chapter 10: Web Services and Beyond 495


var url = "http://api.flickr.com/services/rest/";
var payload = "text=" + searchterm;
payload = AjaxTCR.data.serializeObject(payload,flickrConfig,
"application/x-www-form-urlencoded");
var options = {method:"GET",
payload:payload,
transport: "script",
statusIndicator : { progress :
{type: "text", text: "Searching...", target: "progress" }}};
AjaxTCR.comm.sendRequest(url, options);
}
function handleResponse(response)
{
var resultsDiv = $id("results");
resultsDiv.innerHTML = "";

FIGURE 10-3 Using direct response from Flickr Web Service via <script> call
Free download pdf