title: TypeError: 'append' called on an object that does not implement interface FormData. Again
body: <p>I'm getting these errors in firebug when trying to do an ajax upload, but I can't figure out why. I was unable to find an answer in any previous posts.</p>
  
  <p>1.TypeError: 'append' called on an object that does not implement interface FormData.
  list.appendChild(li);</p>
  
  <p>2.TypeError: list is null
  list.appendChild(li);</p>
  
  <pre><code>&lt;?php
  
      if(!empty($_FILES['images'])){
          if($_FILES['images']['error'][$key]== 0 ){
              move_uploaded_file($_FILES['images']['tmp_name'], "../profile/1.jpg");
              $uploaded='1';
              ///create thumbnail/////
          }
          echo 'Image uploaded'; 
      }
  
  ?&gt;
  
  &lt;!DOCTYPE html&gt;
  
  &lt;html&gt;
  
      &lt;head&gt;
  
          &lt;title&gt;TODO supply a title&lt;/title&gt;
          &lt;meta charset="UTF-8"&gt;
          &lt;meta name="viewport" content="width=device-width"&gt;
          &lt;script src="../media/js/js.js"&gt;&lt;/script&gt;
  
      &lt;/head&gt;
      &lt;body&gt;
  
          &lt;form id="editUserProfile" method="post" action="" enctype="multipart/form-data"&gt;
              &lt;input type="file" id="images" name="images" multiple /&gt;
              &lt;button type="submit" id="btn" &gt;Save&lt;/button&gt;
          &lt;/form&gt;
  
          &lt;div id='response'&gt;
  
              &lt;ul id='image-list'&gt;
  
              &lt;/ul&gt;
  
          &lt;/div&gt;
  
          &lt;script type='text/javascript'&gt;
  
          (function (){
  
              var input=document.getElementById('images'),
                  formdata=false;
  
              function showUploadedItem(source){
                  var list=document.getElementById('image-list'),
                      li=document.createElement('li'),
                      img=document.createElement('img');
                  img.src=source;
                  li.appendChild(img);
                  list.appendChild(li);
              }
  
              if(window.FormData){
                  formdata=new FormData();
                  document.getElementById('btn').style.display="none";
              }
  
              input.addEventListener('change', function(evt){
                  document.getElementById('response').innerHTML='Uploading...'; 
                  var i=0,len=this.files.length,img,reader,file;
  
                  for(; i&lt; len; i++){
                       file=this.files[i];
  
                       if(!!file.type.match(/image.*/)){
                            if(window.FileReader){
                                reader = new FileReader();
                                reader.onloadend=function(e){
                                    showUploadedItem(e.target.result, file.fileName);
                                };
                                reader.readAsDataURL(file);
                            }
                            if(formdata){
                                formdata.append("images[]", file);
                            }
                       }
                  }
  
                 if(formdata){
                     $.ajax({
                         url:'a.php',
                         type:'POST',
                         data:formdata,
                         proccessData:false,
                         contentType:false,
                         success:function(res){
                             document.getelementById('response').innerHTML=res;
                         }
                     });
                 }
              },false);
          }());
  
          &lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>