You supply the action
and method
properties on a form, and then when it's submitted, it completes that HTTP method
using the url specified in action
. The end result takes the user to a new page, the page returned by the server in response to a POST (or whatever) to that target URL.
What causes this redirect? Is it an intrinsic property of how HTML form elements work, or is it just a redirect header in the HTTP response?
I'm trying to reproduce that effect with an ajax POST, without just manually writing a line of JS to do the redirect~ I want it to happen automatically, the same way.
Is submitting a form essentially the same as going to the url www.myHostDomain.com/mySpecifiedFormAction?myFirstFormField=myFirstFormValue&mySecondFormField=mySecondFormValue
?
That can't be right, since the browser bar is always a GET request.