What's wrong in my code? I am trying to check the referrer. If the visitor came from any path on google or any of its subdomain (wildcard), then they will continue to website. If the visitor didn't...


What's wrong in my code? I am trying to check the referrer. If the visitor came from  any path on google or any of its subdomain (wildcard), then they will continue to website. If the visitor didn't come from google, then redirect it to bing.com.


My code:


if (ref.match(/^https?:\/\/([^\/]+\.)?google\.com(\/|$)/i)) {
// do nothing
} else {
window.location.replace("https://bing.com");
}



Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here