Check if current url matches string
I am trying to check if a link exists in the url of the current page in the menu.
var thisUrl = window.location.href;
$("ul.leftmenu li a").each(function() {
var thisHref = $(this).attr('href');
if (thisUrl === thisHref) {
// matches
}
});
This works as long as the current window location url does not contain _GET variables. How do I change this to ignore the _GET variables at the current address?
+3
source to share