解決IE下location.href丟失refer信息
相信有很多朋友,用javascript做一些跳轉時,往往發現refer信息丟失了。為了解決該問題,在IE下,模擬一下點擊事件即可!
function jumpTo (url) {
var isIE = !-[1,];
if (isIE) {
var link = document.createElement("a");
link.href = url;
link.style.display = 'none';
document.body.appendChild(link);
link.click();
} else {
window.location.href = url;
}
}
var isIE = !-[1,];
if (isIE) {
var link = document.createElement("a");
link.href = url;
link.style.display = 'none';
document.body.appendChild(link);
link.click();
} else {
window.location.href = url;
}
}
posted on 2011-11-17 16:54 leisure 閱讀(1067) 評論(0) 編輯 收藏 所屬分類: javascript