I suggest using jQuery because some of the previous examples are already using it, which means it is most likely already included in your project, thus adding no additional override.
When it comes to sending data, I typically use a few different formats depending on whether I’m interacting with a REST API or if I’m POSTing a standard form. There are two major differences when changing between types:
content-typeof the AJAX request is different. The default form when performing an AJAX request using jQuery is application/x-www-form-urlencoded. This would be used for a standard form POST. A typical
content-typewhen working with a REST API would be
application/jsonwhen working in JSON.
In Example 8-1, I will create a standard form that leverages several Knockout bindings. When the form is submitted, it will be done via AJAX using the standard form POST. ...