I'm trying to search for a specific string within URL and if the value is found, I want the script to return a page type.
I was using a simple indexOf, but it doesn't allow for RegEx & I can't seem to make this script work with using match.
I'm a newbie & any help is appreciated! :)
if ((window.location.href.indexOf("/czech-job-server/") > -1) || (window.location.href.indexOf("/prague/czech/") > -1)) {
return("Detail");
}
else if (window.location.href.indexOf("jobs") > -1) {
return("Category");
}
else {
return("Page Not Defined");
}