gpt4 book ai didi

javascript - window.location.href(var) ff7 上的奇怪行为

转载 作者:行者123 更新时间:2023-11-28 21:15:35 26 4
gpt4 key购买 nike

我不明白我在 FF7 上遇到的问题

我有一个返回 json 对象 (jquery) 的 ajax 调用。

if(data.result=='ok') {
var url = baseURL + "azioni/makeForm/" + data.actcode + "/DIA/" + data.az_id;
console.log(url);
window.location.href(url);
}

根本不起作用,但这个可以:

if(data.result=='ok') {
var url = baseURL + "azioni/makeForm/" + data.actcode + "/DIA/" + data.az_id;
console.log(url);
window.location.href = 'http://www.google.com/';
window.location.href(url);
}

为什么?

请注意,console.log 工作正常并输出正确的 url!

最佳答案

也许可以尝试一下:

if(data.result=='ok') {
var url = baseURL+"azioni/makeForm/"+data.actcode+"/DIA/"+data.az_id;console.log(url);
window.location.href = url;

}

关于javascript - window.location.href(var) ff7 上的奇怪行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7714909/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com