You can use for
for looping through array elements:
var url = ["aaa", "bbb", "ccc"]
for (var i = 0; i < url.length; i++)
{
if (window.location.href.indexOf(url[i]) > -1)
{
$("#wrap").css({display: 'block'});
$("#nav").css({display: 'block'});
break;
}
}
1
solved Declaring variables jQuery