Quantcast
Channel: Hacker News
Viewing all articles
Browse latest Browse all 25817

Ask HN: Why does Google put the query in the URL hash instead of query string?

$
0
0

If you are search from any place (toolbar, addressbar) other than google.com, your search query would be passed in as a query string.

But once you are already on google.com search page, the entire page need not be reloaded. So google would fetch the search results for the new search string via a XHR and update the page.

In fact if you search for https://www.google.com/search?q=wonderland#q=alice, the webpage would first load the search results for 'wonderland' and once the page is loaded, there would be another XHR for 'alice' and the DOM would be updated again with the new results.


> Because subsequent searches aren't full page reloads.

This does not mean google cannot rewrite the url without reloading the page (via history.pushState). But less browsers supports this [1] (IE9, browsers from 2009, and some android browsers).

[1]: http://caniuse.com/#search=history.pushState


Correct. The only service which can provide you with google queries is google analytics.

So if you want the data, you are forced to help spread the google drag net across the internet.


Viewing all articles
Browse latest Browse all 25817

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>