Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 316
payling Avatar asked Dec 06 '25 20:12

payling


2 Answers

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.

like image 172
Magnar Avatar answered Dec 08 '25 10:12

Magnar


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

like image 42
Darin Dimitrov Avatar answered Dec 08 '25 12:12

Darin Dimitrov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!