Matthew H
Matthew H

Reputation: 5879

How Do Google and Bing's Autocompletion Work?

How Do Google and Bing's Autocompletion Work?

When I use firebug I see no XHR's. In that case, how is the data retrieved?

Upvotes: 0

Views: 704

Answers (2)

Gareth
Gareth

Reputation: 138082

XHR is restricted to the same domain as the source request, whereas Google and Bing use separate domains to serve their dynamic content.

Instead, they dynamically load new data by adding <script> tags to the page (which show up in the "All" tab of Firebug)

Upvotes: 4

SLaks
SLaks

Reputation: 887509

They create <script> elements that point to URLs that return Javascript that calls a function with the results of the autocomplete. (Similar to JSONP)

You can see the requests in Firebug's Net tab.

Upvotes: 3

Related Questions