0

Possible Duplicate:
Changing browser's address bar without refreshing

I am developing a shopping cart, in it I have multiple collections, by clicking on one collection, all products corresponding to that collection should display and the url in the address bar should be like this:

http://example.com/collection1

I have tried

window.history.pushState('Object', 'Title', '/new-url');

This works fine in all browsers except IE. However I have also tried

window.location.hash = 'collection_name';

But it shows url like http://example.com/index.html#collection1, which is not correct in my case.

Can anyone help me to resolve this problem??

Community
  • 1
  • 1
Dev007
  • 16
  • 1
  • 1
    If IE does not support `window.history`, then there is no way to get the same URL without reloading the page. That's just how it is. Libraries abstract from this and use `window.history` where available and fall back to the hash solution when necessary. This will generate different URLs, but you will get the same result at least. – Felix Kling Apr 24 '12 at 09:36
  • check out this [article](http://stackoverflow.com/questions/10261393/change-url-link-with-javascript-without-refresh/10261417#10261417). this topic was already investigated there – Tobias Krogh Apr 24 '12 at 09:38
  • 1
    You cant do it without refresh – Denis Ermolin Apr 24 '12 at 09:38
  • Have you tried out below link: [http://stackoverflow.com/questions/824349/modify-the-url-without-reloading-the-page](http://stackoverflow.com/questions/824349/modify-the-url-without-reloading-the-page) this will may helpful to you. – Chandresh M Apr 24 '12 at 09:41

0 Answers0