views:

118

answers:

2

How does Google append search parameters to url without reloading page?

Does anyone know how they do it? I know about the HASH trick and the webkit pushState function. I don't think they are using either.

Their solution is cross browser compatible, do they use a combination of different methods for each browser?

+1  A: 

You can add parameters after the hash sign (#) without reloading the page using the window.location.hash property.

Darin Dimitrov
+6  A: 

Google uses the hash-trick. Notice that all the parameters are after

http://www.google.com/#

Edit: If you entered the page with other parameters, the # may be further out in the link.

Magnar
We must be using a different search engine... I don't see any # in my searches =0
payling
On instant search you will find it does.
Gazler
I do, it's right after the .com.
Robert
Google instant on Chrome, Firefox and Safari all use the # here. What search engine are you using? :-)
Magnar
Gotcha, the instant search does use it! I was expecting the # to be after the google.com/# but it's further down the parameter list only when the instant search is used. Thanks
payling
That explains the confusion. Added it to my answer :-)
Magnar