$(document).ready(function(){
btnSubmit.addEventListener("click", () => {
var fullName = itemInputs[0].value,
phone = itemInputs[1].value,
street = itemInputs[2].value,
houseNumber = itemInputs[3].value;
console.log(fullName,phone,street,houseNumber);
});
$.ajax({
url: "php/data_processing.php",
type: "POST",
cache: false,
data: {ajax: 'yes',
name: fullName,
phone: phone,
street: street,
hnumber: houseNumber
},
success: function (data) {
console.log(data);
}
});
});
if(isset($_POST['ajax'])) {
echo $_POST['name'], $_POST['phone'] , $_POST['street'], $_POST['hnumber'];
}
$(document).ready(function(){
btnSubmit.addEventListener("click", () => {
var fullName = itemInputs[0].value,
phone = itemInputs[1].value,
street = itemInputs[2].value,
houseNumber = itemInputs[3].value;
console.log(fullName,phone,street,houseNumber);
});
$.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);
}
});
});
if(isset($_POST['ajax'])) {
echo $_POST['fullName'], $_POST['phone'] , $_POST['street'], $_POST['houseNumber'];
echo 'все норм!';
}
$.ajax({
url: "php/data_processing.php",
type: "POST",
cache: false,
data: { fullName: fullName, phone: phone, street: street, houseNumber: houseNumber },
dataType: "html",
success: function () {
console.log("Вывод чипсов");
}
});
<div class="message">Cсылка успешно скопирована в буфер обмена!</div>
div.message {
position:absolote;
top:100px;
text-align:center;
transition:0.5s;
color:white;
padding:10px;
background-color:lime;
transform:scale(0);
opacity:0;
}
$('.btn').click(function(){
$(".message").addClass("active");
setTimeout(function () {
$(".message").removeClass("active");
}, 2000);
});
div.message.active{
transform:scale(1);
opacity:1;
}