title: Javascript, Jquery 3 - Run get request before anything else
body: <p>At the beginning of the file I have the following code:</p>
  
  <pre><code>$.get(
      "/users/getInfo",
      "json"
  ).done(function(data){
      window.User = data
  })
  
  
  import './components/map'
  import './components/search'
  import './components/jobs'
  import './components/pagination'
  import './components/pages'
  import './components/users'
  </code></pre>
  
  <p>I will need <strong>window.User</strong> data in the code later on. Is it possible to force everything else to wait for the get request to be done?</p>
  
  <p>I am trying this approach because I don't wanna expose user data directly with a code similar to this one:</p>
  
  <pre><code> &lt;script&gt;var User = &lt;?php echo $user; ?&gt;;&lt;/script&gt;
  </code></pre>
  
  <p>The code from above will be minified so the user data will be a bit harder to find if anyone tries to find it.</p>