mercredi 24 juillet 2019

document.referrer if statement is not working

document.referrer conditional always shows the former statement as true, but it shouldn't be

if (document.referrer == "https://parks.com/parks/cummins-falls" || "https://parks.com/parks/events/falls" || "https://parks.com/parks/promotions/falls" || "https://parks.com/parks/go-green/falls" || "https://parks.com/parks/info/falls") { 
console.log("Don't Show Modal - coming from a Falls page", document.referrer);
} else {
console.log("Show Modal - coming from some other Page", document.referrer);
$( window ).on('load', function() {
   console.log("modal firing");
   $('#modal').modal({
   backdrop: 'static',
   keyboard: false,
   show: true
   });
});
}

when a user enters the web page from a Falls page, the modal should not show. if a user enters the web page from a page other than any of the Falls pages, the modal should show.

Aucun commentaire:

Enregistrer un commentaire