龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > Javascript编程 >

可保留referer的自动跳转

时间:2011-08-05 09:51来源:未知 作者:admin 点击:
分享到:
模拟点击的跳转,并且兼容ie和火狐。

function goTo(url) {
     alert(url);
     var a = document.createElement("a");
     if(!a.click) { //only IE has this (at the moment);
         window.location = url;
         return;
     }
     a.setAttribute("href", url);
     a.style.display = "none";
     document.body.appendChild(a);
     a.click();
 }
精彩图集

赞助商链接