Originally Posted by q1h
The above code uses a form submission.
nope. though you hook in on the form’s submit
event, you cancel the form submission on the last line.
and if it were indeed submitting the form, the AJAX call would be pointless because when the response comes back, the handling JS code is gone due to the (re)load.