Re:Ask HN: Why does Google put the query in the URL hash ins...
by dx034 on Monday January 09, 2017 @02:45AM
(#13354713)
Interesting that your alice/wonderland example works. Would've thought Google would try to prevent that.
[ Parent
| on HN ]
Re:Ask HN: Why does Google put the query in the URL hash ins...
by Sacho on Monday January 09, 2017 @02:54AM
(#13354745)
I don't think they can - iirc the hash isn't sent to the server, so to it this looks like any other normal query.
Re:Ask HN: Why does Google put the query in the URL hash ins...
by lucb1e on Monday January 09, 2017 @03:11AM
(#13354802)
Well 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.
Re:Ask HN: Why does Google put the query in the URL hash ins...
by comboy on Monday January 09, 2017 @05:32AM
(#13355343)
Why all the downvotes? I think he means that it could prevent the alice query, not the wonderland.
Re:Ask HN: Why does Google put the query in the URL hash ins...
by baby on Monday January 09, 2017 @04:56AM
(#13355222)
the 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.
Re:Ask HN: Why does Google put the query in the URL hash ins...
by lucb1e on Monday January 09, 2017 @07:11AM
(#13355747)
That'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.
Re:Ask HN: Why does Google put the query in the URL hash ins...
by qeternity on Monday January 09, 2017 @05:00AM
(#13355237)
Where do you think the initial js comes from? The "wonderland" query.
Re:Ask HN: Why does Google put the query in the URL hash ins...
by lucb1e on Monday January 09, 2017 @07:12AM
(#13355753)
I 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.
Re:Ask HN: Why does Google put the query in the URL hash ins...
by onion2k on Monday January 09, 2017 @03:13AM
(#13354811)
As 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".
Re:Ask HN: Why does Google put the query in the URL hash ins...
by diamondo25 on Monday January 09, 2017 @03:44AM
(#13354922)
Don't forget that the hash part is client sided; Google doesn't know about it until the page is loaded.