Topic: 【原创】隐藏页面链接地址(兼容IE和Firefox)

  Print this page

1.【原创】隐藏页面链接地址(兼容IE和Firefox) Copy to clipboard
Posted by: thorlst
Posted on: 2008-10-11 07:22

//屏蔽掉浏览器状态栏显示真是链接地址。使用此脚本时候,在页面最后面加载
var URLS;
var url_regex=new RegExp("http://*");
var href_header="http://goto.link";
var href_footer=".html";

function forbidSeeRealLinks(){
var olinks=document.links;
URLS=new Array(olinks.length);
for(var i=0;i<olinks.length;i++){
var link=olinks[i];
if(validateURL(link.href)&&(link.onclick==null)&&(link.target.length<1)){
URLS[i]=link.href;
link.href=href_header+i+href_footer;
link.onclick=function(){return gotolink(this);};
}
}
}

function validateURL(link){
return url_regex.test(link);
}

function gotolink(A){
var link=A.href;
var i=link.replace(href_header,"").replace(href_footer,"").replace("/","");
window.location.replace(URLS[i]);
return false;
}

forbidSeeRealLinks();

forbidSeeRealLinks.js (0.81k)


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923