I'm using the following JavaScript to get the pathname to show a link is selected:
var pathname = window.location.pathname;
$(document).ready(function ()
{
$('ul#ui-ajax-tabs li a').each(function()
{
if ($(this).attr('href') == pathname)
{
$(this).parents('li').addClass('selected');
}
});
});
However it has problems if that URL has extra parameters such as /
on the end of the url or additional parameters (see examples below) Is it possible to check if the link matches part of the url so for example:
The Link is: /Organisations/Journal/
And the Current page is: /Organisations/Journal/Edit/21
This would class as being selected as it matches part of the url!