Ajax-jquery Serialize subsequent success functions cannot be performed

Source: Internet
Author: User
Ajax form jqueryphp functions

The thing is, I use JQ serialize submit a form content to PHP, after successful display "Submit Success"
After a few tries, I found that every time I submit a content, the URL will change (that is, the form content), then the page will be refreshed, and then after the successful submission of the function it will not be executed.
If I commit the content two times exactly the same, the URL does not change, the successful submission of the function will be executed, this is how to recycle, not to say that Ajax will not refresh the page?
The following is the JQ function
$ (document). Ready (function () {
$ ("#submitform2"). Click (function () {
$.ajax ({
Type: ' POST ',
URL: ' newalead.php ',
Data: $ (' #form1 '). Serialize (),
Success:function () {
Alert (' Submit success ');}
});
})
})

  • 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.