I need some help with this for loop.. my code is supposed to run on these specific url's but It seems to skip over the loop and apply to all pages. Thanks
$(document).ready(function () {
if (isValidUrl()) {
displayBoot();
setupBootEvents();
}
});
function isValidUrl() {
var isValid = false,
validUrls = [
"/sport/btts-match-result",
"/sport/double-delight",
"/sport/recently-paid-out",
"/promotions",
"/promotions/Sports",
"/lotto",
"/virtual",
"/bingo"
];
for (var i in validUrls) {
var currentUrl = window.location.pathname + window.location.search;
if (currentUrl == validUrls[i]) {
isValid = true;
}
}
//return isValid;
return true;
}
function displayBoot() {...
function setupBootEvents() {...