Joke Collection Website - Public benefit messages - How does javascript validate the verification code in a session?

How does javascript validate the verification code in a session?

Tell me the principle.

1, js gets the input verification code of the text box. Send to the background processing page.

2. The processing page receives the value (parameter) sent by js and compares it with the version verification code. Output the comparison result (equivalent to returning the result)

3.js receives the result (true or false) returned by the background processing page, thus prompting the user whether the verification code is correct.

It is suggested that ajax is more convenient. It can also be implemented in Iframe.