Skip to content


用js创建隐藏来源不带referer的超链接

最直接的是用window.open,对IE9以下有效,Firefox无效

  1. function openwin2(strurl){
  2. window.open(strurl, "newwin", "height=650,width=778,scrollbars=10,resizable=yes");
  3. }

进阶版,IE6会报错

  1. function open_new_window(full_link){
  2.     window.open('javascript:window.name;', '<script>location.replace("'+full_link+'")<\/script>');
  3.  }

高级版,用基于HTML5标准rel=”noreferrer” 并配合noreferrer.js
可以自动识别浏览器并选择最优方案
分为prototype.js




和jquery版




external link

注意将nofrerrer.js中的google地址改成百度的.
http://www.baidu.com/link?url?q

参考:
http://zhongfox.github.io/blog/javascript/2013/08/16/remove-referer-using-js/
https://github.com/knu/noreferrer

Posted in JavaScript/DOM/XML.

Tagged with , .


No Responses (yet)

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.