我有两个 html 文件 index.html 和 test.html,我想在按下按钮时从索引导航到测试。
我试过了,但效果不佳。
function change_page(){
console.log("change_page");
$('body').load( "test.html");
}
<input type="button" value="create page" onclick="change_page();"/>
如果你有更好的方法,请告诉我。
最佳答案
function change_page(){
window.location.href = "test.html";
}
<input type="button" value="create page" onclick="change_page()"/>
关于javascript - 在 html 文件之间导航,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24903148/