I'd like to have a little easter egg button in the corner of a project site. When clicked, it just drops a string onto the current url and reloads the page.
So if I'm on: http://test.com/projects/view/134
The button is clicked
Page reload on: http://test.com/projects/view/134?ts=true
Not really sure how I might go about doing so though.
Just like that.
You can assign location.href to the value it currently has, plus your new querystring:
(edited to be friendly to existing querystrings)
Or to be more succinct:
Do you mean:
If you want to account for the potential existence of a hash "#" in the URL, proceed as follows: