I've been looking around JQuery libraries for the URL hash, but found none that were good. There is the "history plugin", but we all know it's buggy and isn't flexible.
I am loading my pages inside a div. I'll need a way to do back/forward along with the url hashing.
mydomain.com/#home mydomain.com/#aboutus mydomain.com/#register
What's the best library that can handle all of this?
The hash is always maintained as a valid URL, so any "page" in jQuery Mobile can be bookmarked or referenced in a link. To retrieve a non-hash-based URL, simply remove the # from the address and refresh the page. In general, hash changes are created whenever a link is clicked in jQuery Mobile.
Get hash value for the current URL Alternatively, if you need a hash value for the current window URL, you can just use window. location. hash , which returns a string containing a '#' , followed by the fragment identifier of the URL. If the URL does not have a fragment identifier, this returns an empty string, "" .
I recently looked at 3 different plugins - jquery history plugin, history, and jQuery BBQ.
They were all quite hard to setup, I did get jQuery.history working but it still had problems with IE7. So I changed to BBQ and it worked fine across all our target browsers (IE6, IE7, IE8, Fx3).
So I recommend the jQuery BBQ plugin.
Edit: here's a blog post I just wrote which demonstrates jQuery BBQ with cascading dropdowns.
Have you tried jQuery Address? From Asual, the guys who made SWFAdress. Asual - jquery Address
The jQuery Address plugin provides powerful deep linking capabilities and allows the creation of unique virtual addresses that can point to a website section or an application state.
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