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