title: JavaScript function working in IE but not Firefox
body: <p>We have a JavaScript/AJAX call in one of our main <code>.js</code> files, which works fine in IE 9 but craps out in Firefox 24.6. The function is supposed to load various folders from a specified area and display them on the page. Here is what the code looks like:</p>
  
  <pre><code>   folders.load({
              url: url,
              callback: function(records, operation, success) {   
   LINE 732   --&gt;     if (records.length == 0) {
                          store.tree.root.set("text", "No Documents Available");               
                      }
                      for (var i = 0; i &lt; records.length; i++) {
                          buildNode(records[i]);
                      }
                      buildDocumentGrid();
                      store.sort();
                      treePanel.openDirectory(new queryString().get("directory", null));
              }
            });
  </code></pre>
  
  <p>The page loads perfectly fine in IE. But when we try it in Firefox we get this error to the console:</p>
  
  <pre><code>TypeError: records is null
  http://www.example.com/public/site/js/committee-docs.js
  Line 732
  </code></pre>
  
  <p>There is no reason for <code>records</code> to be null but when a break point is added, it is in fact null. Using the exact same url in IE gives us success. Is there some kind of rule that IE chooses to ignore completely but causes Firefox problems? The error does not appear in IEs console, only Firefox. </p>
  
  <p>My question is why does this error occur in IE and not in FF? It is the same code and the <code>if (records.length == 0) {</code> is meant to handle empty results. Here is the error output to the console:</p>
  
  <pre><code>TypeError: records is null     committee-docs.js (line 732)
  "NetworkError: 403 Forbidden - http://www.example.com/public/data/load/rt_zonal.jsp"
  rt_zonal.jsp
  
  "NetworkError: 403 Forbidden - http://www.example.com/public/data/lbmp/rt_zonal.jsp"
  rt_zonal.jsp
  
  "NetworkError: 404 Not Found - http://www.example.com/_vti_bin/MetaDataDoc/MetaDoc.svc/getfolders/?folder=%2Fsecure%2Fwebdocs%2Fmarkets_operations%2Fcommittees%2Foc%2Fmeeting_materials&amp;_dc=1408707654820&amp;page=1&amp;start=0&amp;limit=25"
  ?folde...imit=25
  
  TypeError: records is null
  if (records.length == 0) {
  "NetworkError: 404 Not Found - http://server:10190/crossdomain.xml"
  </code></pre>