如何通过javascript包含获取网址引用? [英] How do you get the Url Referer via a javascript include?

查看:47
本文介绍了如何通过javascript包含获取网址引用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在google上搜索某事并单击结果(mytestsite.com),则该站点的引荐来源将是google搜索的URL.

If I search for something on google and click on a result (mytestsite.com), the referer to that site will be URL of the google search.

该站点上现在有一个用于跟踪目的的JS文件include ..但是,该JS文件请求的引荐来源是mytestsite.com ...没有办法让处理JS请求的服务器知道源自Google搜索吗?

Now on that site, there is a JS file include that is used for tracking purposes..however the referrer to that JS file request is mytestsite.com...is there no way for the server handling the JS request to know that it originated from a google search?

推荐答案

脚本标签将始终引用提供该文档的文档.如果您在服务器上执行特殊操作,则可能需要考虑使用会话或cookie.

A script tag will always refer to the document that is sourcing it. If you're doing something special on the server you might want to consider using a session or cookies.

这篇关于如何通过javascript包含获取网址引用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆