Question

If you click on a result in Google Instant, the referer sent by your browser to the destination website contains a bunch of parameters, including the all important q=[autocompleted query]

But you're coming from a page whose URL is simply http://www.google.com/ with a bunch of stuff after the # character, i.e. as an on-page anchor.

So the browser appears to be sending a URL as the referer which is different from the URL of the page that you were viewing when you clicked.

There doesn't seem to be an additional redirection, so how on earth do they do that?

Was it helpful?

Solution

Most of the time, a Google search result actually sends you to a Google redirect page rather than directly to the target page. They use JavaScript to switch the target of the link onmousedown as you click on it.

You can see this effect by click-and-holding on the search result link and watching your status bar.

This isn't specific to Google Instant, they've been doing it for quite a long time on their standard results pages.

OTHER TIPS

The page anchor part of the URL can be manipulated client-side without a new request to the server. Even when talking about static anchor links (e.g. <a href="#foo">Section Foo</a>), clicking on them does not cause a new request to be sent to the server; it is processed completely within the browser.

The javascript being used by Google to make Google Instant work is simply altering the anchor programatically before making a request to the server.

What Google are you using?

My URL after searching is this:

http://www.google.es/#sclient=psy&hl=es&q=something+to+search&aq=f&aqi=g4g-o1&aql=&oq=&gs_rfai=&pbx=1&fp=b0....

It does include the q= part

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top