I just want to location my html tag in my current jsp page,it means that I do not need to jump to the controller.Now I use the code,but it always jump to the controller,how to change my code?
My website url is
http://localhost:8888/MySpringMVC/,and I have a div called
headdiv in the top.When user click the link,I want to locate it to the
headdiv.My current web page url is
http://localhost:8888/MySpringMVC/main/index. I want to jump to
The second thing you tried should work (
<a href="#top-container">TEST</a>), works in my tests which means there is probably more to it than you wrote in your question.
<a href="" onclick="window.location.hash = 'top-container'; return false;">TEST</a>