I am trying to handle the popstate event.The problem is that in the same page i use links like:
- localhost/item/category
- localhost/item/category/subcategory
So i have 2 ajax functions to load contents for each of above examples.When i press the back button of browser, i go back with 2 different ways:
- localhost/item/category/subcategory2 , to --> localhost/item/category/subcategory1
or
- localhost/item/category/subcategory to--> localhost/item/category
How can i check every time the url and according to this, call one of my 2 ajax functions to load the correct content?