|
|
Registered tutorials: 501 Registered Users: 33355
|
|
Rating: 0 out of 0 votes cast
Category: Ajax and PHP
|
Ajax Google Suggest
Abstract: This tutorial will walk you through creating a search suggest similar in fashion to that of Google Suggest using AJAX technologies.
Suggest is one of the better AJAX patterns that I have run across. It certainly can make a site much more user friendly if implemented properly. What we will be creating probably won't be that useful, but it will give you a good understanding of how to implement a robust version on your own site.
The tutorial consists of a HTML page for presenting the suggest searchbox, a JavaScript file for handling the AJAX functionality, and a simple server-side PHP page that returns a new-line separated list of suggested searches.
The suggestions returned from the server are based on my page titles. In real world implementations, you would probably want to make this more robust to suggest searches that other users have looked for in the past.
The database table structure for this tutorial has two simple columns: suggest_id and title. All we really need is the title, but I always provide a primary key for any table that I create.
CREATE TABLE `suggest` ( `suggest_id` INT(11) NOT NULL AUTO_INCREMENT, `title` VARCHAR(255) DEFAULT NULL, PRIMARY KEY (`suggest_id`) );
We can add as many different values as we like in the title field.
|
Reviews:
Rate and Review This Site
No reviews yet
Statistic Information About this Resource:
| Total Hits: |
305 |
| Unique Hits: |
251 |
| |
Daily |
Weekly |
Monthly |
| |
Unique |
Total |
Unique |
Total |
Unique |
Total |
| Average |
0 |
0 |
1.3 |
1.7 |
5.4 |
6.3 |
| Current |
0 |
0 |
0 |
0 |
0 |
0 |
| Previous |
0 |
0 |
1 |
1 |
10 |
12 |
| Dec 2 |
0 |
0 |
3 |
5 |
10 |
14 |
| Dec 1 |
0 |
0 |
0 |
0 |
4 |
4 |
| Nov 30 |
0 |
0 |
2 |
2 |
7 |
9 |
| Nov 29 |
0 |
0 |
0 |
0 |
4 |
4 |
| Nov 28 |
0 |
0 |
4 |
4 |
3 |
3 |
| Nov 27 |
0 |
0 |
0 |
0 |
0 |
0 |
| Nov 26 |
0 |
0 |
0 |
0 |
8 |
9 |
| Nov 25 |
0 |
0 |
3 |
5 |
8 |
8 |
| Highest |
4 |
7 |
13 |
17 |
48 |
57 |
|
|
|
Script Execution Time: 0.42535 | SQL Queries: 10 | Members: 501
Ajax Tutorial Top List - Powered by Aardvark Topsites PHP 5.1.2
|