【发布时间】:2025-12-30 05:30:11
【问题描述】:
我在按下按钮时打开一个新的 html 文件:
window.location = "menu.html";
我想在按下按钮后返回“菜单”活动中的 index.html 文件。 我尝试使用
window.location = "index.html";
但它会创建一个新屏幕,如果我单击返回按钮转到我的主页,它会返回到以前的活动。还有
window.opener.location = '/redirect.html';
window.close();
不起作用。那么如何关闭菜单活动以返回我的主要活动。
PS:我应该使用 window.location 还是 window.location.href 打开新的 html 文件
提前致谢!
【问题讨论】:
标签: javascript html phonegap