Javascript to handle manipulating url anchor for bookmarking

Posted by ajma on Stack Overflow See other posts from Stack Overflow or by ajma
Published on 2009-04-15T17:20:05Z Indexed on 2010/06/18 2:53 UTC
Read the original article Hit count: 533

Filed under:
|
|

Hello, I'd like to use the anchor part of the url (after the #) so that my page can have ajax/dhtml but still be able to have bookmarks work properly. I'm wondering is someone can help me get started on writing some javascript code for this. I'm using jQuery, but if the solution's a generic one, that's fine too.

For my page, I could have settings like: "a" could be a number from 10-50 "b" is a 0 or 1 "c" is a 0 or 1 etc...

I'd like some tips on writing optimized javascript code which could both parse and set something like #a=23&b=0&c=1

Also, I'd like to keep my url as short as possible, so if the default of "a" was 23, in the example above, the a=23 would be omitted.

Is there a library that does all this stuff already?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about url