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>
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745595323a4635077.html
评论列表(0条)