Hi,
I’m trying to add some custom JS that swaps an image src depending on the referrer. I think the code is correct and I’ve added it to the customizer. However, it’s not working. I am wondering if there is some issue with how I am inserting it, or it working with X. Any suggestions would be greatly appreciated. Thanks.
The code is:
if (!/facebook\.com/.test(document.referrer)) {
document.getElementById('staffImage').src = 'https://treehouserecovery.com/wp-
content/uploads/2018/03/Justin-mcmillen-founder-ceo-tree-house-recovery.jpg';
} else{
document.getElementById('staffImage').src = 'http://treehouserecovery.com/wp-content/uploads/2018/03/andrew-
schneider-medical-director-tree-house-recovery.jpg';
}
