title: Pass AJAX data to multiple pages
body: <p>I have a HTML page through which I need to pass two variables through post method to a PHP page which accept those two variables and call an API to fetch the result from those two variables.
  Now, my requirement is to get the API result back to first page.
  I am not able to get it.</p>
  
  <p>From index.html, I am calling another page with - </p>
  
  <pre><code>$.ajax({
      url: "data.php",
      type: 'POST',
      data: {
          difficulty: term,
          cr : country
      },
      success: function (res) {
          console.log(res);
      }
  </code></pre>
  
  <p>In data.php, I am taking parameters through POST method and calling API,</p>
  
  <pre><code>$(document).ready(function(){
          var data;
  
          $.ajax({
              url: "https://key***.co*/api?key="+api_key,
              dataType: "json",
              data: {
                  difficulty: &lt;?php echo $diff; ?&gt;,
                  cr : &lt;?php echo $cr; ?&gt;
              },
              success: function (res) {
                  data =  difficulty;
  
              }
          });
  
      }
  </code></pre>
  
  <p>Here the api_key is defined above. How to fetch the data back to index.html?</p>