首页 > 解决方案 > 为什么从一页移动到另一页不起作用?

问题描述

如果我输入正确的用户名和密码,我想从一个页面移动到另一个页面。为此我使用window.location.href

但是当我尝试使用它时,它说即使两个页面都在同一个文件夹中,另一个页面也被删除或移动了

if(UN == "a" && PA == "123"){
         window.location.href="<file:///C:/Users/user/Desktop/ProudMom/secondPage.html>";

标签: javascripthtml

解决方案


尝试这个:

if(UN == "a" && PA == "123"){
    window.location.href="secondPage.html";
}

推荐阅读