tkyk/jquery-history-plugin — Issue #40: How to replace non fragment path/URL
Author: alexcroox
Created: 2011-10-20 14:57:33+00:00
State: open

I have a video site and an issue where the history URL adds to the end of a non fragment URL.

If the user hits the page domain.com/video-slug and then clicks to view another video the following URL is created:

domain.com/video-slug#/new-video

Is there anyway to strip anything after the domain trailing slash before inserting the hash URL?

The only thing I could think of was to detect the lack of fragment URL and refresh the page with the fragment URL in place, e.g:

domain.com/#/video-slug

Was hoping there might be a cleaner way though.