title: Why zero after ajax call
body: <p>I am learning Ajax first time with WordPress. I am implementing Ajax functionality with widget but I am getting 0 after form is submit.</p>
  
  <p>Can you guide me and explain why this is happening so i can understand better.</p>
  
  <p>My Code:</p>
  
  <pre><code>wp_enqueue_script('jquery');
  
  /**
   * Add function to widgets_init that'll load our widget.
   * @since 0.1
   */
  add_action( 'widgets_init', 'example_load_widgets' );
  
  /**
   * Register our widget.
   * 'Example_Widget' is the widget class used below.
   *
   * @since 0.1
   */
  function example_load_widgets() {
      register_widget( 'Example_Widget' );
  }
  
  /**
   * Example Widget class.
   * This class handles everything that needs to be handled with the widget:
   * the settings, form, display, and update.  Nice!
   *
   * @since 0.1
   */
  class Example_Widget extends WP_Widget {
  
      /**
       * Widget setup.
       */
      function Example_Widget() {
          /* Widget settings. */
          $widget_ops = array( 'classname' =&gt; 'example', 'description' =&gt; __('An example widget that displays a person\'s name and sex.', 'example') );
  
          /* Widget control settings. */
          $control_ops = array( 'width' =&gt; 300, 'height' =&gt; 350, 'id_base' =&gt; 'example-widget' );
  
          /* Create the widget. */
          $this-&gt;WP_Widget( 'example-widget', __('Example Widget', 'example'), $widget_ops, $control_ops );
      }
  
      /**
       * How to display the widget on the screen.
       */
      function widget() {
              echo $name = $_POST['name'];
              ?&gt;
              &lt;form type="post" action="" id="newCustomerForm"&gt;
  
                  &lt;label for="name"&gt;Name:&lt;/label&gt;
                  &lt;input name="name" type="text" /&gt;
  
                  &lt;input type="hidden" name="action" value="example_load_widgets"/&gt;
                  &lt;input type="submit" name="submit" value="Submit"&gt;
              &lt;/form&gt;
              &lt;br/&gt;&lt;br/&gt;
              &lt;div id="feedback"&gt;&lt;/div&gt;
              &lt;br/&gt;&lt;br/&gt;
  
              &lt;script type="text/javascript"&gt;
                  jQuery('#newCustomerForm').submit(ajaxSubmit);
  
                  function ajaxSubmit(){
  
                      var newCustomerForm = jQuery(this).serialize();
  
                      jQuery.ajax({
                          type:"POST",
                          url: "http://localhost/testing/wordpress/wp-admin/admin-ajax.php",
                          data: newCustomerForm,
                          success:function(data){
                              jQuery("#feedback").html(data);
                          },
                          error: function(errorThrown){
                              alert(errorThrown);
                          }  
                      });
  
                      return false;
                  }
              &lt;/script&gt;
  
              &lt;?php
              die();
              add_action('wp_ajax_example_load_widgets', 'example_load_widgets');
              add_action('wp_ajax_nopriv_example_load_widgets', 'example_load_widgets');
  
          }
      }
  </code></pre>