By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,369 Members | 1,001 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,369 IT Pros & Developers. It's quick & easy.

Determining referring URL and search term

P: n/a
I have very limited experience with Javascript. Can someone refer me to
info on how to determine the referring URL and the search term used by a
visitor just prior to his landing on my web page?

Many thanks,
George


Feb 4 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
George wrote on 04 feb 2006 in comp.lang.javascript:
I have very limited experience with Javascript. Can someone refer me to
info on how to determine the referring URL and the search term used by a
visitor just prior to his landing on my web page?


You cannot in general.

Only if your page is reached by a referral from another page,
you can with some browsers get a referral string:

Clientside javascript:

<script type='text/javascript>
document.write( document.referrer );
</script>

Serverside ASP javascript:

<% = request.ServerVariables("HTTP_REFERER") %>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Feb 4 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.