链接HTML中的推荐人 [英] Link Referrer in HTML
问题描述
我想问一个关于HTML标签的rel属性的问题(实际上,如果这会改变HTML5的话)
我将继续使用示例域名。我的网站是example.com。我有一个链接到example2.com的这个页面。如果我将此链接添加到
< a href =example.comreferrer =referrer.com> ;点击我< / a>
我的推荐人是referrer.com还是example2.com?顺便说一句,有什么可能像这样的代码?给一个随机引用者?
第二个,因为我认为科目是相似的。
- 是否可以隐藏引荐网址?
- 如果是,那么会显示为引用者(在统计程序或
浏览器中)?
长话短说,我想隐藏和/或改变引用者。
我相信元刷新不会留下引荐来源的痕迹< meta http-equiv =refreshcontent =0; url = http://www.example.com>
虽然这里的东西是从onclick( a
)元素获取它,所以您应该 AFAIK能够执行如下操作:
< a onclick =mask('http://www.example.com/')>点击我<< ; / A>
函数掩码(url){
var meta = document.createElement(meta);
meta.setAttribute(http-equiv,refresh);
meta.setAttribute(content,0; url =+ url);
}
免责声明:未经测试
I want to ask a quetion about rel property of a tag in HTML (actually, HTML5 if that will make any difference)
I'll continue with example domain names. My website is example.com. I've a link to this page at example2.com. If I give this link with something like
<a href="example.com" referrer="referrer.com">Click me</a>
will my referrer be referrer.com or example2.com? BTW is there anything possible like that code? Giving a random referrer?
2nd one, because I think subjects are similar.
- Is it possible to hide referrer URL?
- If it's, what will be shown as referrer (in statistics programs or browser)?
Long story short, I want to hide and/or change the referrer.
I believe that a meta refresh does not leave a trace of a referrer <meta http-equiv="refresh" content="0; url=http://www.example.com">
The thing here though, is getting it from an onclick (a
) element, so you should, AFAIK, be able to do something like:
<a onclick="mask('http://www.example.com/')">Click me</a>
function mask(url) {
var meta = document.createElement("meta");
meta.setAttribute("http-equiv", "refresh");
meta.setAttribute("content", "0; url=" + url);
}
Disclaimer: untested
这篇关于链接HTML中的推荐人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!