title: Creating PDF With FPDF using AJAX
body: <p>Here is my button :</p>
  
  <pre><code>&lt;button onclick="GeneratePDF()" class="btn btn-success" style="margin-bottom:2%;width:20%;"&gt;Generate Report&lt;/button&gt;
  </code></pre>
  
  <p>Here is my Javascript : </p>
  
  <pre><code>function GeneratePDF(){      
      $.get("function_and_ajax/ajax.php", {
          ajx: "GeneratePDF"
      }, function (result) {
  
      });
  }
  </code></pre>
  
  <p>My jquery : </p>
  
  <pre><code>if($_GET['ajx'] == "GeneratePDF"){   
        GeneratePDF($type,$start,$end);
  }
  </code></pre>
  
  <p>My PHP Function : </p>
  
  <pre><code> function GeneratePDF($type,$start,$end){
                  $pdf= new FPDF();
                  $pdf-&gt;SetAuthor('Lombok Idjoe Kediri');
  
                  $pdf-&gt;SetAuthor('Lana Kovacevic');
                  $pdf-&gt;SetTitle('FPDF tutorial');
  
                  $pdf-&gt;SetXY (10,50);
                  $pdf-&gt;SetFontSize(10);
                  $pdf-&gt;Write(5,'Congratulations! You have generated a PDF.');
  
                  //Output the document
                  $pdf-&gt;Output('example1.pdf','I');
  }
  </code></pre>
  
  <p>when i clicked my button, nothing happen...</p>