Dynamic generated HTML deep linking
I have a problem with deep linking. I have a single page site, in which I have many small boxes and a single big boxes, that is the 'active' content. Clicking on a small box, I clear the innerHTML. Wtart an animation, the clicked become the active content, then I replace the innerHTML($('element').html('new content')) with the new content.
My question is: there is a way to deep开发者_Python百科 link this process, to have:
mysite.com/firstcontent (or something similar) and have the right content active, without have to write a mega-switcher? have I to replace all with AJAX?
Typically this is handled by changing the hash (test.html*#foo*) in the window.location
.
You can do this in conjunction with the hashchange
event and window.history.pushState
/ replaceState
You will need some sort of shim for older browsers. There is a jQuery plugin that will supposedly handle this for you.
精彩评论