title: How to ensure dynamic CSS is loaded first before AJAX content?
body: <p>I need help on timing issues between CSS file and HTML code from AJAX. I am loading CSS by just adding link in the head and also I am loading HTML content by AJAX.</p>
  
  <p>My intention is to apply styles(in profile_info.css file) on the dynamic contents(generated by profile_info.php). thats why i am first downloading css then asking ajax to get the content.</p>
  
  <p>How can I ensure that CSS is loaded first so that styles can be applied on the dynamic HTML content? Here is the code:</p>
  
  <pre><code>$('head').append( $('&lt;link rel="stylesheet" type="text/css" /&gt;').attr('href', 'css/profile_info.css') );
  
  $.get('/ajax/controllers/profile_info.php',
      {id: user_id},
      function(response){
          $('#middle_content').html(response);
      });
  </code></pre>