Front-end - How to achieve partial refresh of form like submission and ajax.
怪我咯
怪我咯 2017-05-16 13:43:45
0
3
892

1. Development environment:

  • Backend: node.js

  • Template:pug(jade)

2.

  • Scenario: The form submits the user name and password, and the background is verified. If the verification fails, the login failure is displayed on the front end. If the verification is successful, it jumps to other pages.

  • Question: If the verification fails, the failure is displayed on the interface, but there is no callback function for form submission, and only the background render fails? But doesn’t the entire page refresh when rendering? But I see that many websites are partially refreshed (segmentfault), and I see that the code is not front-end rendering. How can it be done?

3. Others:
I originally wanted to use ajax instead of form submission, and the backend would return success, failed, and then judge and render on the frontend. But my other websites seem to be all about form submission, partial refresh password errors, etc., such as this website.

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(3)
迷茫

The <form> you see is actually not a form submission. . . It’s still ajax

刘奇

Partial refresh uses jquery’s $.ajax asynchronous submission

伊谢尔伦

The password is wrong, just change display:none to show

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template