function creatXMLHttpRequest(){
var obj =null;
if(window.ActiveObject){
obj = new ActiveObject("Microsoft.XMLHTTP");
}else{
obj = new XMLHttpRequest();
}
return obj;
}
window.οnlοad=function(){
fileinfo=document.getElementById('myheads').files[0];
}
function uploaded(){
var xhr = creatXMLHttpRequest();
var fd = new FormData();
fd.append('myheads',fileinfo);
xhr.onreadystatechange=function(){
if(xhr.readyState==4 && xhr.status ==200){
alert(xhr.responseText);
}
}
xhr.open('post','jsonupload.php');
xhr.send(fd);
}