title: HOW TO check if an external (cross-domain) CSS file is loaded using Javascript
body: <p>I have a function doing the following using <code>javascript</code>:</p>
  
  <ol>
  <li>Create link element and set href=cssFile.</li>
  <li>Insert the link element in head tag.</li>
  <li>Create a div element.</li>
  <li>Set the class name using setAttribute</li>
  <li><code>appendChild</code> the div on body.</li>
  <li>Now getting CSS rule value using <code>document.defaultView.getComputedStyle(divElement, null)[cssRule]</code>.</li>
  </ol>
  
  <p>Now <code>getComputedStyle</code> is returning the default values, and if I wait on <strong>breakpoint</strong> using Firebug before <code>getComputedStyle</code> call, then it returns the CSS rule from the CSS injected.</p>
  
  <p>Regards,<br>
  Munim</p>