Javascript 返回true;没有路由到链接

Javascript 返回true;没有路由到链接,javascript,html,Javascript,Html,验证后无法让我的提交按钮路由到此html页面。。。 罪魁祸首-------------------返回真值;window.location.href=“Info/index.html” 原因:代码无法访问 在代码中: window.location.href= "Info/index.html"; 不会执行,因为您已设置“return”语句 不知道您的具体目的是什么,但您可以这样设置代码: window.location.href= "Info/index.html"; return true

验证后无法让我的提交按钮路由到此html页面。。。 罪魁祸首-------------------返回真值;window.location.href=“Info/index.html”


原因:代码无法访问

在代码中:

window.location.href= "Info/index.html";
不会执行,因为您已设置“return”语句

不知道您的具体目的是什么,但您可以这样设置代码:

window.location.href= "Info/index.html";
return true; 
因此,在将返回值设置为true之前,将执行重定向


祝你好运

您是否尝试放置
window.location.href=“Info/index.html”
;在返回声明之前?是的,很遗憾没有起作用…没有这样的运气-对客户ID运行验证功能,如果在他们单击提交时填写了字段,则会重新发送到另一个页面…window.location.href=“Info/index.html”;返回false;确切地说,实际上不需要return语句,因为一旦执行window.location.href,它下面的代码就会被忽略。因此,“return false”是可选的。
window.location.href= "Info/index.html";
return true;