- struggled to make ajax works, but now is ok
- starting to make serverside works
This commit is contained in:
@@ -5,14 +5,18 @@ sendButton.addEventListener('click', () => {
|
||||
const inputValue = inputElement.value;
|
||||
console.log("inputValue:");
|
||||
console.log(inputValue);
|
||||
PLGNTLS_ajax(inputValue, 'get_data')
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
console.log("dataaa: ");
|
||||
console.log(data);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log("error: ");
|
||||
console.log(error);
|
||||
});
|
||||
//PLGNTLS_ajax('get_data', inputValue)
|
||||
PLGNTLS_fetch('get_data', {
|
||||
body: {inputValue},
|
||||
})
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
console.log("dataaa: ");
|
||||
console.log(data);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log("error: ");
|
||||
console.log(error);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user