Skip to navigation
Post request with ajax
20.08.23
Send a post API request with jQuery, send the data in a Jason format and catch the return to react to possible errors example function what receive the data as a JSON object ```javascript function send_booking(data) { let url = "http://127.0.0.1:8090/foo"; var jqxhr = $.post(url, data,function() { alert( "success" ); }) .done(function() { alert( "second success" ); }) .fail(function() { alert( "error" ); }) .always(function() { alert( "finished" ); },'json'); } ```
https://api.jquery.com/jquery.post/
Reply
Anonymous
Information Epoch 1732409659
Think parallel.
Home
Notebook
Contact us