Javascript 如何重定向到crossrider中的书签URL?
在crossrider中,我在后台代码中有一个函数Javascript 如何重定向到crossrider中的书签URL?,javascript,crossrider,Javascript,Crossrider,在crossrider中,我在后台代码中有一个函数 function buttonClick() { alert(2); // simulates similar behavior as an HTTP redirect var url = "http://12bubbles.com"; window.location.replace(url); } 安装扩展后,当调用buttonClicked()时,确实会弹出警报(),但重定向不起作用。我的代码有问题吗尝试windo
function buttonClick() {
alert(2);
// simulates similar behavior as an HTTP redirect
var url = "http://12bubbles.com";
window.location.replace(url);
}
安装扩展后,当调用buttonClicked()时,确实会弹出
警报()
,但重定向不起作用。我的代码有问题吗尝试window.location.href=url代码>
window.location.href = url;
是正确的语法吗
是正确的语法最终解决了。如果有人面临同样的问题,我必须使用他们自己的API
function buttonClick() {
alert(2);
// simulates similar behavior as an HTTP redirect
var url = "http://12bubbles.com";
appAPI.openURL(url, "current");
}
终于明白了。如果有人面临同样的问题,我必须使用他们自己的API
function buttonClick() {
alert(2);
// simulates similar behavior as an HTTP redirect
var url = "http://12bubbles.com";
appAPI.openURL(url, "current");
}
还是不行。也许这是“Crossrider”特有的东西。我不熟悉Crossrider,但我很惊讶这不管用。也许可以试试window.location=url
?我也试过了。当我在localhost中尝试时,这两种方法都有效,但我无法使它与Crossrider一起工作。无论如何,谢谢你帮了我的忙!!还是不行。也许这是“Crossrider”特有的东西。我不熟悉Crossrider,但我很惊讶这不管用。也许可以试试window.location=url?我也试过了。当我在localhost中尝试时,这两种方法都有效,但我无法使它与Crossrider一起工作。无论如何,谢谢你帮了我的忙!!你能把你的解决方案作为一个答案,并在几天内接受吗。这将真正帮助其他用户。谢谢你能把你的解决方案作为一个答案,并在几天内接受吗。这将真正帮助其他用户。谢谢