YUI Library Examples: AutoComplete Control: Use AutoComplete with Flickr's XML Webservice

AutoComplete Control: Use AutoComplete with Flickr's XML Webservice

This example uses a DataSource that points to Flickr Web Services; Flickr returns XML data via a simple PHP proxy. In order to return valid data from the Flickr application, scriptQueryParameter has been customized to be tags, and scriptQueryAppend is used to pass in additional required arguments. The cache has been disabled so that each query is forced to make a trip to the live application.

This instance of AutoComplete defines a robust custom formatResult() function to format the result data into images in HTML. Automatic highlighting of the first result item in the container has been disabled by setting autoHighlight to false.

Enter Flickr tags to find a photo (separate with commas):

Sample Code

CSS:

Markup:

JavaScript:

Copyright © 2008 Yahoo! Inc. All rights reserved.

Privacy Policy - Terms of Service - Copyright Policy - Job Openings