URL for jQuery Page State

Go To StackoverFlow.com


I am taking over a "one-page" site that uses numerous jQuery show/hide instructions to navigate content—turning divs on and off to reveal images and simulate new windows opening and closing on the page. I need to be able to record "snapshot" URLs of the page in various states. The various states are too complex to be able to manually note them one-by-one. I'm dreaming of an imaginary utility called "show me my dynamic URL right now". I don't care if the resulting URLs are lengthy or untidy. Thank you for your time and patience. I usually solve these sorts of problems through enthusiastic searches of on stackoverflow. I know similar questions have been asked, but the bar has proven too high for me to tease out a solution.

2012-04-04 16:51
by Renn Orenn
by doing a quick search on internet, I found this http://forum.jquery.com/topic/dynamic-url-after-modal-dialog-confirmation take a look, it might be helpful - Grigor 2012-04-04 16:54
I think that https://github.com/balupton/history.js/ might be what you're after. It allows you to (among many other things) place a state object into url - devstruck 2012-04-04 17:04
Thanks very much for your advice. I have been examining history.js carefully. It seems that this and all of the other options I have encountered require pre-designation or "tagging" of each function I wish to track. Unfortunately, the site contains hundreds of jQuery instructions to show, hide or fadein/fadout various divs—sort of like a modal gallery, but all done with handcoding in jQuery - Renn Orenn 2012-04-07 23:26
It would be tedious, but I would still be happy to go through and add a script to each command (rather like _gaq.push for event tracking), but it seems to me that still may not create urls that record the states of various divs. I was hoping to find something that would automatically update the history with every click, or, better still, allow me to record a unique URL for various page states along the way, reflecting the condition of all of the divs with respect to their show/hide state - Renn Orenn 2012-04-07 23:26


Use jQuery Address. It is in use on this site http://nationallgbtmuseum.org/ and allows you to set /#pagename for a certain div, and will scroll the browser to that site, or recognize the site when scrolled to, making each page an adressable section of the site, should do what you want.

2012-04-15 05:51
by rncrtr