title: Ajax - after "success" go to another page retrieve user id from the url there
body: <pre><code>var JSONonj = {"name": "James","age":"25"};
  var data = "This data i would like to retrieve and print in the main.html page after success call in ajax.";
  
  $.ajax({
          url: "/user",
          type: "POST",
          data: JSONobj,
          dataType: "json",
          success: function() {
              window.location.href = "main.html";
          },
          contentType: "application/json"
  });
  </code></pre>
  
  <p>Here is the deal. After success i want to redirect to main.html and when I get there, I would like to retrieve and print data variable there. </p>
  
  <p>The redirection works fine. But I can not receive the data there.  </p>