I'm using this to check if someone came from Reddit, however it doesn't work.
var ref = document.referrer;
if(ref.match("/http://(www.)?reddit.com(/)?(.*)?/gi"){
alert('You came from Reddit');
} else {
alert('No you didn't');
}
Suggestions on the regular expression are most welcome too.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…