So what I'm trying to achieve is have a list of links, where clicking any of them would change the content of a div to 'whatever'. That's easy, I've done that.
The part I'm having trouble with is getting some sort of permalink to the changed content.
say main domain is www.example.com
then you click link X and content Y shows up on the page
then the URL should change to www.example.com/SOMETHINGHERE
--all good so far--
then using the new link should take you to the site with the changed content
let's get some sample code :
<a href="something.html" class="linx" >Click me</a>
<a href="something2.html" class="linx" > Click me too</a>
<div id="loadhere"></div>
$('.linx').click(function (event) {
event.preventDefault();
$('#loadhere').load(this.href);
});
Pretty basic stuff. That's the way it works. Now I've googled a bit, and it seems I need to use the history API or even the history.js library. I've tinkered a bit, but I'm a newb and the whole History thing is a little confusing.
An example close to what I want to achieve is Soulwire's personal website. Navigate to the experiments section and see how running each one, works.
So basically what I'm asking is whether you could help me use the history api (if this is actually the way do this -- I may be wrong) by perhaps giving me an example or something more than linking the documentation, or if there's another way I could try to achieve this.
Thanks in advance.