0

On my current site that I'm developing, I am just appending #whatever to my url, so www.example.com/product#doughdough or www.example.com/product#sweet

Don't get me wrong, it works fine and functions great when using the back button, but I'm curious to see if there are any other "creative" ways of presenting it? Maybe something like www.example.com/products/#/doughdough or www.example.com/#/products/doughdough? Do the added slashes change anything?

Adam
  • 8,349
  • 16
  • 64
  • 126
  • From the browser's point of view and the server's, the slashes don't really change anything. The URL has is still everything after `#` and won't be sent to the server. However, if the page scripts depends on the hash which is now different, you would need to modify them accordingly. – Michael Berkowski Oct 29 '12 at 14:44

2 Answers2

0

The hash technique has many problems, so many that Twitter has stopped using it, switch to using the history API which lets you have real URIs to fall back to a (search engine friendly) server side solution with.

Quentin
  • 800,325
  • 104
  • 1,079
  • 1,205
0

If you don't mind HTML5 only support you can check pushState method.

Good tutorial for using HTML5 History API (Pushstate?)

https://developer.mozilla.org/en-US/docs/DOM/Manipulating_the_browser_history

Community
  • 1
  • 1
silkAdmin
  • 4,170
  • 8
  • 47
  • 81