how can I make an Ajax call instead of post printing the waybill from WordPress on my php website?
<form id="print-shipping-label-form"> <input type="hidden" name="shipping_id" value="<?php echo $result_wpid_shipping['ID']; ?>"> <input type="hidden" name="api_key" value="ce312203c06e8bda7157c408fbac54c4"> <button type="submit" class="btn btn-danger">Drukuj list przewozowy</button> </form> <script> document.addEventListener('DOMContentLoaded', function() { var printShippingLabelForm = document.getElementById('print-shipping-label-form'); if (printShippingLabelForm) { printShippingLabelForm.addEventListener('submit', function(event) { event.preventDefault(); // Zatrzymaj domyślne zachowanie formularza…