Over the next few posts, i will delve into some of the widgets and utilities YUI has to offer for the everyday JavaScript developer. Autocomplete is a great addition to any website that you build because it gives the user an easier way to use a search bar to find a specific spot on your site that they are there for. Nothing will frustrate someone exploring your website more than having to click through multiple levels of pages to find the specific content they originally came for. You have to keep in the mindset that the average user today has absolutely zero patience and wants everything they request to be delivered to them as soon as possible, so provide them with a widget that will do just that.
Autocomplete is very simple to use, and comes along with excellent documentation on how to implement this nifty functionality to your site. It can bring in many different types of datasources to query on (whether it be an array that you declare yourself, if the list isnt long, or a table in a database that includes 5000 rows of words and phrases that pinpoints every nook and cranny of your site). By simply providing the location of this source (if it is a file or query object, you will need to use YUI's IO utility, which i will cover in my next post), the input node for the autocomplete instance to attach itself to, and a few preexisting formatting options for you to choose from, you can have an autocomplete search tool up and running on your site, and in turn, keeping your visitors happy.
http://yuilibrary.com/yui/docs/autocomplete/
No comments:
Post a Comment