When both a query string and anchor tag (hash tag) are visible in a URL, what is the proper order for them to appear?
http://www.whatever.com?var=val#anchor
? should come before the # as noted in RFC 3986:
relative-ref = relative-part [ "?" query ] [ "#" fragment ]
Taken from an answer over at superuser (https://superuser.com/questions/498617/does-an-anchor-tag-come-before-the-query-string-or-after):