How can I retrieve /admin/articles/ from /admin/articles/add using regular expression and jQuery?
I already have the following jQuery code setup, but need help with Regular Expressions
<script>
$(document).ready(function(){
var path = "/" + location.pathname.substring(1);
//Need regular expession here to make 'path' per the above mentioned example
if ( path ) {
$('#idlist a[href$="' + path + '"]').parent().attr('class','active');
}
});
</script>
Thank you all for the help.
Turns
'/admin/articles/add'into'/admin/articles/'.