function GetServices(){ $.ajax({ type: "POST", url: "/GetServices", data: JSON.stringify({ "nummer": document.getElementById('nummer_input').value, }), contentType: "application/json", dataType: 'text json', success: function(response) { document.getElementById('resultblock').innerHTML = response }, error: function(error){ console.log(error); } }); } function GetAllServices(){ console.log("aa") $.ajax({ type: "POST", url: "/GetServices", data: JSON.stringify({ "nummer": "-1", }), contentType: "application/json", dataType: 'text json', success: function(response) { document.getElementById('resultblock').innerHTML = response }, error: function(error){ console.log(error); } }); } function AddService(){ $.ajax({ type: "POST", url: "/AddService", data: JSON.stringify({ "datum": document.getElementById('datum_input').value, "tijd": document.getElementById('tijd_input').value, "van": document.getElementById('van_input').value, "tot": document.getElementById('tot_input').value, }), contentType: "application/json", dataType: 'text json', success: function(response) { document.getElementById('resultblock').innerHTML = response }, error: function(error){ console.log(error); } }); } $(document).ready( function () { GetAllServices(); })