163
rated 0 times
[
165]
[
2]
/ answers: 1 / hits: 55274
/ 15 Years ago, fri, january 8, 2010, 12:00:00
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.
More From » referrer