有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java如何在Spring MVC中使用锚标记在当前jsp中找到固定位置?

我只想在我当前的jsp页面中定位我的html标记,这意味着我不需要跳转到控制器。现在我使用代码,但它总是跳转到控制器,如何更改我的代码? 我的网站url是http://localhost:8888/MySpringMVC/,顶部有一个名为headdiv的div。当用户单击链接时,我想将其定位到headdiv。我当前的网页url是http://localhost:8888/MySpringMVC/main/index。我想跳到http://localhost:8888/MySpringMVC/main/index#top-container

<!--both of ways  jump to http://localhost:8888/MySpringMVC/#top-container-->
<a href="javascript:void(window.location.href='#top-container')">
<a href="#top-container">

共 (0) 个答案