21 lines
532 B
JavaScript
21 lines
532 B
JavaScript
console.log("PLGNTLS_data:");
|
|
console.log(PLGNTLS_data);
|
|
|
|
const title = document.querySelector(".first_el_to_change");
|
|
title.innerHTML = "--- coucou ;) " + PLGNTLS_data.myvar_1;
|
|
|
|
const ajax_button_1 = document.querySelector("#test_ajax_1");
|
|
ajax_button_1.addEventListener('click', () => {
|
|
PLGNTLS_data.ajax(ajax_button_1, 'get_data')
|
|
.then((response) => response.json())
|
|
.then((data) => {
|
|
console.log("datou: ");
|
|
console.log(data);
|
|
})
|
|
.catch((error) => {
|
|
console.log("error: ");
|
|
console.log(error);
|
|
})
|
|
;
|
|
});
|