 <pre><code>The statndard way to interact with ajax in Wordpress through WP AJAX.You can do like this. $.ajax( { type: 'POST', url: "/wp-admin/admin-ajax.php?action=your_action_name", dataType: 'json', cache: false, data:{ your data should be here }, success: function(response) { alert('success'); }, error: function(xhr, textStatus, errorThrown) { alert('error'); } }); then in functions.php or plugin file you need to register a hook for ajax request.wp_ajax should be prefix your action hook name and then method for processing the request. add_action('wp_ajax','method_name'); function method_name(){ here is your code } </code></pre>