在同一页面的不同部分中打开链接

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

我的应用程序中有两个不同的html文件。这样的东西。

<a href="/conversations/<%= c['conversation']['id'] %>" class="list-group-item">
  <div id="nav">
   <p>This is link my second page</p>
  </div>
</a>

这是我的第二页。

div id="nav">
  <p>This is link my second page</p>
</div>

但是当我单击链接时,它会重定向到第二页。我想要的是当我单击要在同一页面的不同部分内打开第二个html的链接时。像这样的东西。enter image description here

我该怎么做?

javascript html jquery css href
1个回答
0
投票

iframe是可用于将其他html页面调用到您的网页中的标签

<iframe src="http://www.google.co.in" name="targetframe" allowTransparency="true" scrolling="no" frameborder="0" >
</iframe>
© www.soinside.com 2019 - 2024. All rights reserved.