title: Check css file loaded or not using document.styleSheets
body: <p>I am checking document.styleSheets for finding whether the file is loaded or not. I am doing,</p>
  
  <pre><code>for (var i = 0, iLen = document.styleSheets.length; i &lt; iLen; i++) {
      var sheet = document.styleSheets[i];
      if (!sheet.href) {
          continue;
      }
      if (sheet.href.indexOf('mypath') &gt; -1 &amp;&amp; sheet.rules.length &gt; 0) {
          // do something
      }
  }
  </code></pre>
  
  <p>But its not working. Is there a way?</p>