I have a treeview inplemented in CSS, when a user clicks a folder on the treeview I'd like to update the URL in the address bar without causing a server round-trip.
The HTML looks a little like this:-
<ol>
<li>
<a href="www.example.com/blah?id=12345">Folder</a>
<ol>
<li>Child</li>
</ol
</li>
<ol>
The CSS I have handles the expanding of the folder but I'd like the Address bar URL to update so I can deep link to a particular folder but there is no need from a code perspective to do a round-trip to the server Is there any way of achiveing this? I have a feeling this might be impossible because of potention phishing??
I'm using HTML5, CSS2/3, jquery and ASP.NET MVC3
HTML5 adds a History API, which allows you to use history.pushState()
in modern browsers to update the URL. You are restricted to the same domain for security reasons.
This won't be supported in IE until IE10. Firefox, Safari, Opera and Chrome have all implemented it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With