wip make ajax automatically added

This commit is contained in:
asus
2024-02-10 19:19:47 +01:00
parent f6ba2a9e2c
commit de6fd7a8a7
6 changed files with 30 additions and 38 deletions

View File

@@ -1,8 +1,11 @@
function ajax_post(data, action, callback_response, callback_error) {
/*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*/
function ajax_post(mydata, action, callback_response, callback_error) {
const data = new FormData();
data.append('action', action);
data.append('_ajax_nonce', php_data.nonce);
data.append('data', data);
data.append('data', mydata);
fetch(php_data.ajax_url, {
method: 'POST',