javascript – How to check if the URL contains a given string?



javascript – How to check if the URL contains a given string?

javascript - How to check if the URL contains a given string?

#short
#javascript
#jquery
#url
How could I do something like this:
script type=”text/javascript”
$(document).ready(function () {
if(window.location.contains(“franky”)) // This doesn’t work, any suggestions?
{
alert(“your url contains the name franky”);
}
});
/script