title: Ajax +wordpress onClick link redirect to new page and create html content
body: <p>i have two pages in my wordpress plugin</p>
  
  <ul>
  <li>index.php</li>
  <li>charts.php</li>
  </ul>
  
  <p>in index.php i have some content and some link..</p>
  
  <pre><code> &lt;a onclick="show_trend()" &gt;Trend&lt;/a&gt;
  </code></pre>
  
  <p>while clicking this link  ,i have an ajax function to create content in charts.php(i dont know if it is correct way)</p>
  
  <pre><code>function show_trend() {
   var data ="action=render_admin_charts_page";
     jQuery.ajax({
                      type: "POST",
                      url: "../wp-admin/admin-ajax.php",
                      data: data,
                      dataType: 'json',
                      success: function(data) {
  
                        alert(data);
                       //here i want to create html content
  
                      }
                  });
  
  }
  </code></pre>
  
  <p>andfollowing  is my php function and hook</p>
  
  <pre><code>function render_admin_charts_page() {
      ?&gt;
      &lt;div class="wrap"&gt;
          &lt;div class="chart"&gt;
  
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;?php
       die();
  }
  add_action( 'wp_ajax_render_admin_charts_page', 'render_admin_charts_page' );
  </code></pre>
  
  <p>now i am getting <code>0</code> as alert  .</p>