I want to check if url contains a directory of words.
This is what I'm trying ...
$(document).ready(function () { if (window.location.href.indexOf("catalogue")) { $("#trail").toggle(); } });
The site URL may be ...
http://site.co.uk/catalogue/
or
http://site.co.uk/catalogue/2/domestic-rainwater.html
and etc.
But that will not work. Can anyone point out where I'm wrong?
source share