is it possible to in javascript like in php header location, if the visitor comes from index html alert something? and how ? thank you
+1 Wow. Had never heard of that, works in Chrome, IE7, and Firefox *at least*.
T.J. Crowder
2010-06-29 14:24:11
+2
A:
Check the referrer, but you most likely will need the absolute uri, like this:
if (document.referrer == 'http://domain.com/index.html')
alert('How was the index?');
Alan Christopher Thomas
2010-06-29 14:24:37
You could of course use the match() method like so if(document.referrer.match("index.php")){ alert(msg) }, but as you rightly say full URL is probably the best idea since it will prevent cross domain matches.
DRL
2010-06-29 14:59:53