Window. location. href = window. location. href jump without response ahyperlink onclick event writing _ javascript skills

Source: Internet
Author: User
In js, the window. location. hrefwindow. location. href jump does not respond. ahyperlink onclick. Click to jump to a solution without a response problem. The error code is mainly in href = "#" here.

The Code is as follows:

Incorrect syntax, mainly in href = "#" here

The script is as follows:

The Code is as follows:


If (data = "sent successfully "){
Alert (data );
Window. location. href = window. location. href;
}

The correct href is followed by a javascript: void (0). If it is IE6, it is best to add a return false after onclick.

1:

The Code is as follows:


Send

2:

The Code is as follows:


Send

3: This writing method is recommended, and ie6 can be perfectly supported.

The Code is as follows:


Send

The three methods above can be used, and there is no difference. When the return false is returned in the buttonClick function, the function is also blocked from continuing to run.

Related Article

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.