是否可以将jsp页面内定义的div中的内容包含到“a href”中的另一个jsp页面中,而无需导入整个jsp页面?

时间:2021-05-29 20:38:44

A possible solution, but with importing, would be:

一个可能的解决方案,但导入,将是:

firstPage.jsp

...
<div id="firstName"> <p> First Name </p> </div>
...

secondPage.jsp

...

<%@include file="firstName.jsp" %>
<a href="#firstName">First Name</a>
...

What I want to do is something like this:

我想做的是这样的:

secondPage.jsp

...
<a href="secondPage.jsp#firstName">First Name</a>
...

Is it possible to reference the div from the first jsp page in the second jsp page without importing the first jsp page?

是否可以从第二个jsp页面中的第一个jsp页面引用div而不导入第一个jsp页面?

1 个解决方案

#1


0  

Use Iframe as the target of the link.As a result the result of the link will be shown inside the iframe which will be in the same page.

使用iframe作为链接的目标。结果,链接的结果将显示在iframe内,该iframe将位于同一页面中。

#1


0  

Use Iframe as the target of the link.As a result the result of the link will be shown inside the iframe which will be in the same page.

使用iframe作为链接的目标。结果,链接的结果将显示在iframe内,该iframe将位于同一页面中。