admin管理员组文章数量:1431918
Say I have included document.referrer()
in my website(www.abc
) and I got redirected to my site from google
.
Will the above mentioned code help me to get google
?
Say I have included document.referrer()
in my website(www.abc.
) and I got redirected to my site from google.
.
Will the above mentioned code help me to get google.
?
- 1 cant try bcoz i dont have any site. .:-( – jagrti Commented May 5, 2011 at 6:47
- 1 try using jsfiddle, you can try out any script you need. Or you rcould even try it yourself on w3schools on there interactive tutorial w3schools./jsref/prop_doc_referrer.asp and w3schools./jsref/tryit.asp?filename=tryjsref_doc_referrer – Tom Gruner Commented May 5, 2011 at 7:01
2 Answers
Reset to default 1The search results in Google are not direct links. For example searching for abc
the first result actual link is:
http://www.google.co.uk/url?sa=t&source=web&cd=1&ved=0CC0QFjAA&url=http%3A%2F%2Fabc.go.%2F&ei=_0nCTeOMFYOVswbY7PyHAQ&usg=AFQjCNHN69w2aXwjgMlF4X6o9W3lKd4uZw
The redirection is then made server side so the code in abc.go.
website might not get proper referrer.
javascript:alert(document.referrer);
When you will insert it at address bar, the previous location will appear, like the addresses appear on address bar, like http://php/manual/en/control-structures.break.php
. You can use it to make plex JavaScript operations, like regular expressions. I will give very simple example
<script type="text/javascript">
if (document.referrer.search('google')==-1){
alert('Not using Google');
} else {
alert('Yes, from Google');
}
</script>
本文标签: Javascript documentreferrerStack Overflow
版权声明:本文标题:Javascript: document.referrer - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745595322a2665443.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论