Joke Collection Website - Public benefit messages - How does jquery implement ajax to verify whether the verification code is correct and add prompts?

How does jquery implement ajax to verify whether the verification code is correct and add prompts?

Send the filled-in verification code string to the background through ajax. After the background receives the string, it will find the actual verification code string from the session, compare the two, and give the comparison result to ajax. , ajax can then make corresponding prompts on the page.

If you want to ask how to implement ajax, it is recommended to use jquery. It has encapsulated the code for ajax and background interaction. You only need to simply write a servlet, and use the servlet to obtain the data submitted by ajax and verify it. The work is handled in the servlet, so that the verification work can be completed.

Give me a hint:

request.getSession().getAttribute("name of variable in session");