如果有人可以帮助我,我对以下代码有疑问,我将不胜感激。基本上,我在调用 url 的页面上的几个页面上有几个链接。目前,/freeten/
即使在窗口中打开了外部页面,它也只在代码部分中调用函数。
if(location.href.match('/extraten/')) {
console.log(window.location.href);
function downloadXM() {
if(location.href.match('/en/')) {
window.location.href = "http://core77.com/";
}
if(location.href.match('/fr/')) {
window.location.href = "http://www.notcot.org/";
}
if(location.href.match('/de/')) {
window.location.href = "http://www.spd.org/";
}
if(location.href.match('/it/')) {
window.location.href = "http://sxsw.com/";
}
}
}
if(location.href.match('/freeten/')) {
function downloadXM() {
if(location.href.match('/en/')) {
window.location.href = "http://www.wired.com/";
}
if(location.href.match('/fr/')) {
window.location.href = "http://www.bbc.co.uk/";
}
if(location.href.match('/de/')) {
window.location.href = "http://edition.cnn.com/";
}
if(location.href.match('/it/')) {
window.location.href = "http://www.sky.com/";
}
}
}