Live data from Hacker News

A game running in your browser's address bar

glench.com

1–10 of 32 posts

Re: A game running in your browser's address bar

#5
post #3

cool..hw does it work?

The code is all there to look at, just right click > view source for most desktop browsers.

But in brief, it's a fairly simple case of using JS to set "window.location.hash" to whatever value necessary. If you want to test this out, you can open your browser's JS console (on any website), and simply type something like this:

  window.location.hash="test"
and it'll update the URL displayed in your navigation bar.

Then it's just a case of using some JS code to generate the text to place in the navigation bar. It's quite a neat idea, but it's also pretty simple.

Post reply on HN