How to set the hyperlink format to remain in HTML but do not implement a jump

Source: Internet
Author: User

---restore content starts---

The teacher assigned a task, require users to log in or do not log in will have a home page (home.jsp), if the login will jump to the login screen (login.jsp), in the login screen has a verification code, but also a lot of login page like "See, change a" text, achieve click "Can't see, change a" to implement the validation code refresh. At the beginning of the index.jsp as a login.jsp to write, and then click "See not clear, for a" can realize the local refresh verification code, the code is as follows

<a href= "#" OnClick = "Checkcode ()" > Can't see Clearly, change a </a>

Because at that time index.jsp is as login.jsp, and index.jsp is the default home page of the project, so no problem, everything OK

When I built a new home.jsp, renamed Index.jsp to Login.jsp and in Web. XML to set home.jsp as the Project home page, visit login.jsp, click on the "Can't See, change a" page to jump directly to the homepage, that is, home.jsp;

Obviously, this is not the result we want; after we've referred to the 50444986 solution, everything is OK.

Here's how to modify it:

<a href= "javascript:void (null);" OnClick = "Checkcode ()" > Not clear, change a </a>

---restore content ends---

How to set the hyperlink format to remain in HTML but do not implement a jump

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.