5 ms·
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
by kc10 10y ago
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 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.
- dx034 10y agoInteresting that your alice/wonderland example works. Would've thought Google would try to prevent that.
- Sacho 10y agoI don't think they can - iirc the hash isn't sent to the server, so to it this looks like any other normal query.
- lucb1e 10y agoWell sure they can, how do you think the search results for "alice" are obtained? It gets sent to the server, just not upon first load but using Javascript. This Javascript could check for another query being present in the query string, or (less reliably) the server could in the referrer.
- baby 10y agothe server doesn't have access to anything following the hashtag. This is only accessible on the client side via javascript. Javascript that you do not have unless the browser send the first request.
- lucb1e 10y agoThat's what I said: > how do you think the search results for "alice" are obtained? It gets sent to the server, just not upon first load but using Javascript.
- qeternity 10y agoWhere do you think the initial js comes from? The "wonderland" query.
- lucb1e 10y agoI know but the comment I was responding to said Google couldn't possibly know about the duplicate parameter. Well, here you have it, they can. Not at first, but still before displaying the results.
- comboy 10y agoWhy all the downvotes? I think he means that it could prevent the alice query, not the wonderland.
- onion2k 10y agoAs far as Google are concerned it makes no difference if the query is a GET variable in the URL or a hash fragment that their JS code sends as a query after the search page is loaded. They both mean "load Google Search with this parameter from the URL".
- diamondo25 10y agoDon't forget that the hash part is client sided; Google doesn't know about it until the page is loaded.
- deleted 10y ago[deleted]
- deleted 10y ago[deleted]
- michaelvillar 10y agoThey could use `pushState` to change the query without reloading the page?
- wmil 10y agoThey could if they were building it now. IE got pushState support in IE 10 in 2012. The hash state has been there since Instant Search was launched in 2010.
- lloeki 10y agoGraceful degradation/progressive enhancement is a thing, though.
- bpicolo 10y agoThe amount of money Google makes supporting older browsers is most likely measured in billions. Not to mention, why fix something that isn't broken? There are cases for it, but it's roughly the same tech that it was 4 years ago. What would they gain by spending developer time on it?
- adamdonahue 10y agoExactly. You are someone who gets it.
- iurisilvio 10y agoPerfect. They definitely don't need optimization for search engines, which is probably the most important reason to a clean URL.
- heisenbit 10y agoI suspect they spend a ton of developer time. It is their #1 source of income. What they won't do is releasing it unless it is 99.9% certain that it yields an improvement.
- untog 10y ago
- wodenokoto 10y agoFor what it is worth, Safari on OSX goes straight to "alice" results, but I think Safari handles google.com differently than other domains.
- oneeyedpigeon 10y agoI'm on Chrome, and even if I search directly from google.com (google.co.uk) I see my search query as a proper query variable.