title: Why IE 9 not supporting JavaScript function?
body: <p>I'm trying to make a function for checking file size and extension on run time, I have done it  and working properly on all browser except ie 9. Can anyone let me know where the problem?</p>
  
  <h2>Javascript</h2>
  
  <pre><code>&lt;script type='text/javascript'&gt;
  function showFileSize() {
      var input, file;
  
      // (Can't use `typeof FileReader === "function"` because apparently
      // it comes back as "object" on some browsers. So just see if it's there
      // at all.)
      if (!window.FileReader) {
          bodyAppend("p", "The file API isn't supported on this browser yet.");
          return;
      }
  
      input = document.getElementById('fileinput');
  
     if (!input.files[0]) {
          bodyAppend("p", "Please select a file before clicking 'Load'");
      }
      else {
          file = input.files[0];
          var sFileName = file.name;
          var sFileExtension = sFileName.split('.')[sFileName.split('.').length - 1].toLowerCase();
  
          bodyAppend("p", "File Type " + sFileExtension + " is " + file.size + " bytes in size");
      }
  }
  
  function bodyAppend(tagName, innerHTML) {
      var elm;
  
      elm = document.createElement(tagName);
      elm.innerHTML = innerHTML;
      document.body.appendChild(elm);
  }
  &lt;/script&gt;
  </code></pre>
  
  <h2>HTML</h2>
  
  <pre><code>&lt;form action='#' onsubmit="return false;"&gt;
  &lt;input type='file' id='fileinput'&gt;
  &lt;input type='button' id='btnLoad' value='Save' onclick='showFileSize();'&gt;
  &lt;/form&gt;
  </code></pre>