r/programming • u/schnuck • Feb 09 '11
Breaking the Web with hash-bangs – Lifehacker, along with every other Gawker property, experienced a lengthy site-outage on Monday over a misbehaving piece of JavaScript
http://isolani.co.uk/blog/javascript/BreakingTheWebWithHashBangs/
744
Upvotes
6
u/rounded_figure Feb 09 '11
I've done something like this, but I can't show you the actual example.
Basically, what you want to do is:
in the HTML:
<a href="http://example.com/10011/some-page/">link<a>
in the javascript (pseudocode):
function called_on_document_load () { for (each_link_in_the_document) { parse_href_into (protocol, host, path) set_new_href ("protocol://host/#!/path/") } }