I use the following to identify the currently selected (active) link on the site:
$(function(){
var path = location.pathname.substring(1);
if ( path )
$('#sidebar_content a[@href$="' + path + '"]').attr('class', 'selected');
});
It seems to identify the path correctly, but also generates an error
Error: uncaught exception: syntax error, unrecognized expression: [@href $ = "clinics / ohs_north_carolina"]
The source of the page does not show that the link has added the class.
Thank you for your help.
Thanks.
source
share