Javascript window.location.href.indexOf is A and not B
javascript
Solution
You have to call `indexOf` twice:
var hasGender = window.location.href.indexOf("gender=men&dir=") != -1;
var hasDir = window.location.href.indexOf("&dir=Schoenen") != -1;
if ( hasGender && ! hasDir ) {
// Do whatever you want...
}
Problem
I'm using the following to do somting when url contains gender=men&dir= ``` if(window.location.href.indexOf("gender=men&dir=") > -1) { } ``` Now i need to say url contains gender=men&dir= and not &dir=Schoenen do something i was trying this only its not working ``` if(window.location.href.indexOf("gender=men&dir=" || !"&dir=Schoenen") > -1) { } ```