cowboy / jquery-hashchange

This jQuery plugin enables very basic bookmarkable #hash history via a cross-browser HTML5 window.onhashchange event.
http://benalman.com/projects/jquery-hashchange-plugin/
GNU General Public License v2.0
1.21k stars 259 forks source link

Error with the latest version of jQuery (1.9.0) - plugin not working anymore #25

Open ghost opened 11 years ago

ghost commented 11 years ago

Hello,

jQuery.browser was removed from the last version of jQuery (v1.9.0) as it was already deprecated since jQuery v1.3. More details here: http://jquery.com/upgrade-guide/1.9/#jquery-browser-removed

The hashchange plugin isn't working anymore as there is an error. Any quick workaround please?

Thanks

DinkDonk commented 11 years ago

A very quick fix, would be to copy line 41 to 75 from https://github.com/jquery/jquery-migrate/blob/master/src/core.js and place it in your script. This would restore the old jQuery.browser method.

You could also just load the whole migration plugin, if you don't mind the overhead :-)