zhangxinba 发表于 2018-12-24 09:45:49

html5

-----------------------------------form.html---------------------------------------

  
  
  
  Document
  
  function send(){
  var pic = document.getElementsByTagName('input').files;
  var fd = new FormData();
  fd.append('pic',pic);
  

  var xmlhttp = new XMLHttpRequest();
  

  xmlhttp.onreadystatechange = function(){
  if( this.readyState == 4 && this.status == 200 ){
  document.getElementById('info').innerHTML = this.responseText;
  }
  }
  

  

  xmlhttp.open('POST','upload.php',true);
   xmlhttp.send(fd);
  }
  
  
  
  
  
  
  

  
  
  
  

  --------------------------------------upload.php-------------------------------------
  
  




页: [1]
查看完整版本: html5