Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 687
  • Last Modified:

Jquery location hash change

I have a menu with 5 li > a items.
Each item when clicked launches a jquery function.
With each menu click I would like to update the location.hash like for example:
click item 1 > function one() is called and location hash gets a #one appened at the end
click item 2 > function two is called and location hash gets a #two appened at the end
and so on

Also, and this is the most important part, if I manually changed the URL of the page from let's say:   siteURL#one to siteURL#two, then automatically the function two() should be called.

Is this possible?
Thanks in advance
0
badwolfff
Asked:
badwolfff
1 Solution
 
animecycCommented:
This is possible both with and without jQuery. One of my favorite plugins to use is this one: jQuery Address

It is both easy to use and very well documented.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now