$(document).ready(function () {
//ready event fired, document ready
btnSubmit.addEventListener("click", () => {
//event listener on btnSubmit fires click event
// Set Variables
var fullname = itemInputs[0].value,
phone = itemInputs[1].value,
street = itemInputs[2].value,
housenumber = itemInputs[3].value;
console.log(fullname, phone, street, housenumber);
//Send aajax
$.ajax({
url: "php/data_processing.php",
type: "POST",
cache: false,
data: {
ajax: 'yes',
fullname: fullname,
phone: phone,
street: street,
housenumber: housenumber
},
success: function (data) {
console.log(data);
}
});
});
//previous place of ajax
console.log('print imediately after ready events fired')
});
btnSubmit.addEventListener("click", () => {
$(document).ready(function () {