JSP pages write anchor points, and HTML pages write anchor points

Source: Internet
Author: User

HTML anchors are written in a way that is incompatible with JSP. So when you write dynamic Web pages, you need to be aware

One: How to write an anchor point in an HTML page

1 HTML Anchor Point 2 3 <a href= "#abc" >goto1</a>45 <a name= "abc" >111</a>6 7 so that from Goto1 can be positioned to 111
View Code

Two: How to write the anchor point in JSP page

JSP anchor Point <a href= "javascript:void (0)" onclick= "document.getElementById (' abc '). scrollIntoView ();" >goto1</a><a id= "ABC" >1111</a>
View Code

JSP page writing an anchor point another way

1  2 3 today in the JSP page want to use a tag anchor point to achieve in the page positioning, a method for 4 5 <a href= "javascript:void (0)" onclick= "window.location.hash= ' View '" ></a>67 <a name= "View" ></a>
View Code

Another way for JSP pages to write anchor points

1  <a href= "left.jsp #first" > Chapter One </a>2 <a name= "First" > Chapter I content </a>34 // to set the anchor point, you need to write the path first. Even the anchor point of this page requires some path. Denial will jump to the following item, or an error
View Code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.