读取服务器文件
var xhr=new XMLHttpRequest();
xhr.onreadystatuschange=function(){
if(xhr.readystate===4&&xhr.status===200)
console.log(xhr.responseText);}
xhr.open('get',url,true);
xhr.send();
读取本地文件
function readfile(id){
d=var file=document.getElementById(id).files[0];
var reader=new FileReader();
reader.readAsText(file);
reader.function(data){
console.log(data,this.result);
}