Answer the question
In order to leave comments, you need to log in
How to send an ajax request, given that the site is on wordpress?
Please tell me, from the point of view of the Ajax request in wordpress, is this code written correctly? If yes, how can I make sure that the data came to the dae file?
Below is a diagram of what should happen after pressing the button. The action marked in red is already being executed by
calculate.js:
jQuery( function( $ ){
jQuery( 'button-range-submit' ).click(function(){
const body = {
}
jQuery.ajax({
url: 'https://maxcredit.proiectmd.com/dae/',
type: 'POST',
contentType: 'application/json',
data: JSON.stringify({getoutSUM: outSUM, getoutVal: outVal, getarrDate: arrDate}),
success: function( data ) {
console.log( data );
}
});
});
});
Answer the question
In order to leave comments, you need to log in
Yes, WP has its own rules for working with AJAX, now I'll throw off the link.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question