I have to select a landing page if an user has been there. Then a variable might be returned with some string. I have used page.url.indexOf and mbox.name.indexOf but nothing happens. Can you help me?
This's the code I was trying:
var r;
if (page.url.indexOf("additionalCardHiring") > -1 || page.url.indexOf("additionalCardProducts") > -1 || page.url.indexOf("additional-card-products") > -1 || page.url.indexOf("funds-hiring") > -1){
r = "atdc";
}
else if (page.url.indexOf("fundsHiring") > -1 || page.name.indexOf("fundsHiring") > -1 || page.url.indexOf("funds-hiring") > -1 || mbox.name.indexOf("fundsHiring") > -1 || page.url.indexOf("additional-card-products") > -1 || page.url.indexOf("additional-card-hiring") > -1) {
r ="fci";
}
else {
r = "dft";
}
return r;
This code always returns "dft". Thoose strings in indexOf() methods are from localStorage url, mbox name (supossed), adobeTarget.pageName() and location.href url.
Thank you!