title: Submitting ajax on page load
body: <p>So I am submitting my AJAX just before the page is loaded and calling it on the same page like this after ajax.</p>
  
  <pre><code>&lt;input type="text" class="hidden" id="storeID" value="&lt;?php echo $_GET['store']; ?&gt;"&gt;
  $(document).ready(function()
  {
  var store = $("#storeID").val();
  $.ajax(
  {
    url: '../user-style.php',
    method: 'POST',
    data: {"store":store}
  });
  });
  &lt;link rel="stylesheet" href="../user-style.php" media="screen" /&gt;
  </code></pre>
  
  <p>user-style.php</p>
  
  <pre><code>if(isset($_POST['store']))
  {
  $stmtgetstyle = $mysqli-&gt;prepare("SELECT * FROM store_style_configuration WHERE store_id=?");
  $stmtgetstyle-&gt;bind_param("i", $_GET['store']);
  $stmtgetstyle-&gt;execute();
  $getstyle = $stmtgetstyle-&gt;get_result();
  $style = $getstyle-&gt;fetch_assoc();
  $stmtgetstyle-&gt;close();
  }
  </code></pre>
  
  <p>But user-style.php isn't getting any data neither any thing is from database is coming. </p>