title: Fallback plan for loading fontawesome
body: <p><strong>UPDATE:</strong> to make my question clearer, I referred the following code snippet and implemented something similar-</p>
  
  <pre><code>&lt;script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  if (typeof jQuery == 'undefined') {
      document.write(unescape("%3Cscript src='/js/jquery-1.4.2.min.js' type='text/javascript'%3E%3C/script%3E"));
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>I'm loading <code>font-awesome.css</code> and the fallback in my <code>JSP</code> this way-</p>
  
  <pre><code>&lt;link type="text/css" rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/3.1.1/css/font-awesome.min.css" /&gt;
  
  &lt;script&gt;
      function fallbackForFontAwesome() {
          if (typeof bootstrapcdn == "undefined") {
              document.write(unescape('%3Clink type="text/css" rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/3.1.1/css/font-awesome.min.css" /%3E'));
              if (typeof cloudflare == "undefined") {
                  document.write(unescape('%3Clink type="text/css" rel="stylesheet" href="/common/fontawesome/css/font-awesome.min.css" /%3E'));
              } else {
                  alert('loading from cloudfare');
              }
          } else {
              alert('loading from bootstrap cdn');
          }
      }
      fallbackForFontAwesome();
  &lt;/script&gt;
  </code></pre>
  
  <p>As per this code snippet, I expected for the execution of <code>alert('loading from bootstrap cdn');</code> to happen. But it didn't. 
  Does the code <code>if (typeof bootstrapcdn == "undefined")</code> and <code>if (typeof cloudflare == "undefined")</code> check if the css has been loaded from respective URLs or not?
  Am I going wrong somewhere?</p>