title: Ajax not working in Wordpress Plugin
body: <p>I am trying to build a form with Ajax functionality for a Wordpress plugin. A jQuery function is being called but no response is being displayed.</p>
  
  <p>Here is the <strong>Ajax code</strong></p>
  
  <pre><code>function ajaxformschool() {
      var id = "Hello World";
      jQuery.ajax({
          type: 'POST',
          url: ajaxschoolajax.ajaxurl,
          action: 'ajaxschool_process',
          data: {"data":id},
          dataType: 'json',
          success: function(data) {
              alert(data);
              jQuery("#comment").html(data);
          }
      });
  }       
  </code></pre>
  
  <p><strong>Front end and registering Ajax Code</strong></p>
  
  <pre><code>function ajaxschool_enqueuescripts() {
      wp_enqueue_script('ajaxschool', ASSFURL. '/js/ajaxschool.js', array('jquery'));
      wp_localize_script('ajaxschool', 'ajaxschoolajax', array( 'ajaxurl' =&gt; admin_url( 'admin-ajax.php')));
  }
  
  add_action('wp_enqueue_scripts', ajaxschool_enqueuescripts);
  &lt;form&gt;
      echo '&lt;a onclick="ajaxformschool();" style="cursor: pointer"&gt;&lt;b&gt;Search&lt;/b&gt;&lt;/a&gt;';
      echo '&lt;div id="comment"&gt;&lt;/div&gt;';
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>Ajax Function Action</strong></p>
  
  <pre><code>function ajaxschool_process() {
      $response="thanks everythong is ok";
      echo json_encode($response);
      die($response);
  }
  
  add_action( 'wp_ajax_nopriv_ajaxschool_process', 'ajaxschool_process' );
  add_action( 'wp_ajax_ajaxschool_process', 'ajaxschool_process' );
  </code></pre>