JavaScript if URL contains Needle

if (window.location.href.indexOf("franky") > -1) {
   alert("your url contains the name franky");
}