Found surfing RSS feeds of someone else’s tagged bag… If you’ve not come across the beta of Google’s new feature, take a peek at Google Suggest, which works like autocomplete by responding with common/popular search queries based on the first few letters you type in the search field.

What do you think? Dose of good, evil, or apathy?

Anyhow, Adam Stiles opened up the JavaScript scope to detail how this works..

Google’s Suggest feature is lighting up the blogosphere these days. It functions as like autocomplete for your search box, where Google attempts to determine what you are searching for and gives you suggestions. Web tinkerer that I am, I had to dig in a little and see how this works.

At its simplest, Google Suggest is javascript code that looks at what you are typing in the Google search box. When you press a key, GS phones home and passes the current contents of the search box. The server returns some suggestions are then displayed to the user. The javascript code is a little obfuscated, more to keep the size down than to obscure the contents.

Good hacks abound!

The post "Dissecting the Code: Google Suggest" was originally pulled like taffy through a needle's eye at CogDogBlog ( on December 13, 2004.

Comments are closed.