window.location 在 github 页面中不起作用[已关闭]

问题描述 投票:0回答:0

我在 github 中上传我的项目,但下一页

movies.html
未显示。如果您在
movies.html
上的我的搜索栏中搜索电影,它应该会转到下一页
index.html
。请参阅下面的链接。

github 仓库

电影网站

在我的

script.js
中,我使用了
window.location.href
,但是当我搜索电影时,它说
404 There isn't a GitHub Pages site here.

searchBox.addEventListener("submit", (event) => {
  const searchBarValue = document.getElementById("searchbar").value;
  event.preventDefault();
    localStorage.setItem('key', searchBarValue);
// console.log(window.location)
  window.location.href = `${window.location.origin}/movies/movies.html`;
});
javascript html window.location
© www.soinside.com 2019 - 2024. All rights reserved.