now ajax is in PLGMTLS object as a method
This commit is contained in:
@@ -6,5 +6,15 @@ title.innerHTML = "--- coucou ;) " + PLGNTLS_data.myvar_1;
|
||||
|
||||
const ajax_button_1 = document.querySelector("#test_ajax_1");
|
||||
ajax_button_1.addEventListener('click', () => {
|
||||
ajax_post(ajax_button_1, 'get_data');
|
||||
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);
|
||||
})
|
||||
;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user