Ajax functionality not being called under wordpress plugin
Syntax error comes from your js file that is containing php code. You don’t need this part to be in the js file and need to be in a php file. <?php function form_ajax_process_request() { if( isset( $_POST[“post_var”] ) ) { $response = $_POST[“post_var”]; echo $response; die(); } } add_action(‘wp_ajax_form_response’,’form_ajax_process_request’); add_action(‘wp_ajax_nopriv_form_response’,’form_ajax_process_request’); ?> This part need … Read more