$(document).ready(function() {
$('#form').submit(function(e) {
e.preventDefault();
$.ajax({
type: 'POST',
url: 'chat.php',
data: $('#form').serialize() + '&' + this.name + '=' + this.value,
success: function(data) {
console.log(data);
}
});
});
});
pagination: {
el: '.swiper-pagination',
dynamicBullets: true, //включаем поддержку динамических буллетов
dynamicMainBullets: 7, //максимальное количество отображаемых буллетов
},
function checkForButton(btnClass) {
return new Promise(resolve => {
if (document.querySelector(btnClass)) {
return resolve(document.querySelector(btnClass));
}
const observer = new MutationObserver(mutations => {
if (document.querySelector(btnClass)) {
resolve(document.querySelector(btnClass));
observer.disconnect();
}
});
observer.observe(document.body, {
childList: true,
subtree: true
});
});
}
checkForButton('.lebxEowGMdQOJbKlCudYTsrHjNGIkpUfgm').then((elm) => {
elm.click();
});
function printCountry (response) {
console.log(response)
}
function printCountry (response) {
let result = response[0];
let a_keys = ['name', 'region', 'subregion', 'capital', 'flag'];
a_keys.forEach(function(el) {
$('#' + el).text(el == 'name' ? result.name.common : result[el]);
});
}