在html文件之间导航 [英] Navigate between html files

查看:84
本文介绍了在html文件之间导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个html文件index.html和test.html,我想从索引导航到按下按钮时进行测试。

I have two html file index.html and test.html and I want to navigate from index to test when pressing a button.

我试过这个,但它是
$ b

I tried this but it is not working well .

function change_page(){
   console.log("change_page");
   $('body').load( "test.html");
} 


<input type="button" value="create page" onclick="change_page();"/>

如果您知道更好的方法,请告诉我。

If you know some better way, please tell me.

推荐答案

function change_page(){
  window.location.href = "test.html";
} 


<input type="button" value="create page" onclick="change_page()"/>

这篇关于在html文件之间导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆