Header location in javascript
is it possible to in javascript like in php header location, if the visitor 开发者_StackOverflow中文版comes from index html alert something? and how ? thank you
if(document.referrer == url){ alert(msg); }
Should do it.
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?');
精彩评论