可保留referer的自动跳转
模拟点击的跳转,并且兼容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();
}
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();
}
- 上一篇:JavaScript定时器(自定义)实现方法
- 下一篇:至强弹窗代码
精彩图集
精彩文章