Book Image

jQuery 2.0 Development Cookbook

By : Leon Revill
Book Image

jQuery 2.0 Development Cookbook

By: Leon Revill

Overview of this book

Table of Contents (17 chapters)
jQuery 2.0 Development Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating an autosuggest feature


Autosuggest features are in abundance on the Internet. There are many plugins available for jQuery and jQuery UI which will allow you to add the autosuggest feature to your site quickly and easily. This recipe will show you how to create one from scratch which you can customize and add your own unique features to.

Getting ready

The server-side code for this recipe mirrors that of the previous one. Ensure that you have a web server and a MySQL database server running and ready to use.

How to do it…

The following are the steps to create an autosuggest feature:

  1. Please refer to the previous recipe of this chapter, Creating a search feature, to create and set up a stationary database and the search.php script. We will be using the exact same code for the autosuggest feature.

  2. Within the web root of your web server, create an HTML file named recipe-8.html. Add the following HTML code to create the basics of the autosuggest user interface:

    <!DOCTYPE html>
    <html...