changed add_var_to_front back to using add_inline instead as localize, because need to not overwrite the variables

This commit is contained in:
asus
2024-02-11 17:07:27 +01:00
parent de6fd7a8a7
commit 87a0f7fc0b
9 changed files with 58 additions and 21 deletions

View File

@@ -1,13 +1,17 @@
/*
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*/
function ajax_post(mydata, action, callback_response, callback_error) {
function ajax_post(ajax_data, action, callback_response, callback_error) {
console.log("in ajac_post, ajax_data :");
console.log(ajax_data);
const data = new FormData();
data.append('action', action);
data.append('_ajax_nonce', php_data.nonce);
data.append('data', mydata);
data.append('_ajax_nonce', nonce);
data.append('data', ajax_data);
console.log("data: ");
console.log(data);
fetch(php_data.ajax_url, {
fetch(ajax_url, {
method: 'POST',
credentials: 'same-origin',
body: data