I want to do he following, but it does not work:
if(pathname == '/ik/services/' || '/ik/recruitment/'){
//run function
}
It is completely ignoring my if statement and executes the code for all pages...
I want to do he following, but it does not work:
if(pathname == '/ik/services/' || '/ik/recruitment/'){
//run function
}
It is completely ignoring my if statement and executes the code for all pages...
Try this:
This has nothing to do with jQuery, it's just a normal JS "error". You need to compare both strings with the variable:
try doing
Try
OR
jQuery
inArray
Example
You would have to do something like this:
Your
|| '/ik/recruitment/'
would always be truthy, and therfor the code within your if-statement will always run.