$.ajax({
url: "/wp-admin/admin-ajax.php",
method: 'post',
functions.php
you can not include it. But /wp-admin/admin-ajax.php
is not include, there rises slightly lightweight version of WordPress which is designed only to take your submitted data, determine what action you want to use, and through this action to transfer the data to a handler that hangs on this action. And now, in functions.php
you on this action Packed format wp_ajax_{$action}
and wp_ajax_nopriv_{$action}is
connected to your processor, which will accept the posted data, do with them whatever you need and return the response which in turn /wp-admin/admin-ajax.php
going back to your js./wp-admin/admin-ajax.php
and some of the questions she will disappear.Find more questions by tags WordPress