Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the best library to do a URL hash/history in JQuery? [closed]

Tags:

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?

like image 910
TIMEX Avatar asked Mar 01 '10 20:03

TIMEX


People also ask

What is jQuery hash?

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.

How do I know if a URL has a hash?

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, "" .


2 Answers

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.

like image 96
Matt Frear Avatar answered Sep 29 '22 05:09

Matt Frear


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.

like image 32
Batailley Avatar answered Sep 29 '22 05:09

Batailley