找到你要的答案

Q:Linking multiple html pages

Q:将多个HTML页面

I have used bootstrap nav nav-pills nav-justified

and i have 7 of these

<li><a href="form.html">Form</a></li> 

I have been able to click on form which will re-direct to the form page, but I can't seem to return to my home page without clicking back on the browser. I want to be able to just click on the Home button which i've included as part of my 7 <li>s I mentioned earlier. Also i would like to be able jump onto each page from the navbar tab.

<div class="header">
    <div class="container">
        <ul class="nav nav-pills nav-justified">
            <li><a href "#">Home</a></li>
            <li><a href "#">About</a></li>
            <li><a href "#">JavaScript</a></li>
            <li><a href "#">JQuery</a></li>
            <li><a href="AngularJS.html">AngularJS</a></li>
            <li><a href "#">API</a></li>
            <li><a href="form.html">Form</a></li>
            <li><a href "#">Contact</a></li>
        </ul>
    </div>
</div>

So from that above, when i click on form, im on the form page, but i cannot go back to the homepage(index.html) unless i click back on the browser, i wanna be able to link to all the lists by clicking each other.

我用Bootstrap资产净值资产净值NAV为丸

我有7个

<li><a href="form.html">Form</a></li> 

我已经能够点击表格,将重新直接到表单页,但我不能返回到我的主页没有点击浏览器。我想能够点击我包括我的7 & lt部分主页按钮;李>;我前面提到的。我也希望能跳到每一页的导航栏标签。

<div class="header">
    <div class="container">
        <ul class="nav nav-pills nav-justified">
            <li><a href "#">Home</a></li>
            <li><a href "#">About</a></li>
            <li><a href "#">JavaScript</a></li>
            <li><a href "#">JQuery</a></li>
            <li><a href="AngularJS.html">AngularJS</a></li>
            <li><a href "#">API</a></li>
            <li><a href="form.html">Form</a></li>
            <li><a href "#">Contact</a></li>
        </ul>
    </div>
</div>

所以从这上面,当我点击的形式,我在表单网页,但我不能回到主页(index。html)除非我回来点击浏览器,我想能链接到所有的点击对方的列表。

answer1: 回答1:

Consider using Ajax to load different pages dynamically (with association with jQuery it said to be simpler to use) for the desired behavior or put everything on the single page and show content only when user clicks the link by JS and CSS.

As soon as you use Bootstrap elements you probably have jQuery already included in your project.

Useful links:


Check this page jQuery.get there is a very demonstrative example

$.get("demo_test.asp", function(data, status)
{
    alert("Data: " + data + "\nStatus: " + status);
});

where data - data received from the server. It should be your html code to replace the content.

To insert data use:

$.('#Content').html(data);   //id="Content" is from the comment

考虑使用Ajax加载不同的页面动态(关联与jQuery它说是简单的使用)所需的行为或东西放在单页显示的内容只有当用户点击链接的JS和CSS。

当你使用引导元素,你可能有jQuery已经包含在你的项目。

有用的链接:


请在此页jquery.get有一个示范的例子

$.get("demo_test.asp", function(data, status)
{
    alert("Data: " + data + "\nStatus: " + status);
});

从服务器接收数据的地方。它应该是你的HTML代码替换内容。

插入数据使用:

$.('#Content').html(data);   //id="Content" is from the comment
answer2: 回答2:

if you do this in a local host and you created these files as i find out when you click on the home you get 404 page the only thing that you have to do is to link your homepage file to the home button if i'm wrong comment me and explain your problem more and then i will help you.

如果你在本地主机上这样做,你创建这些文件,我发现当你点击主页你得到404页的唯一的事情,你要做的是连接主页文件到主页按钮,如果我是错误的评论我,并解释你的问题更多,然后我会帮助你。

html  css  twitter-bootstrap