function api(url,fn){
let xhr = new XMLHttpRequest
xhr.open('POST', url, true)
xhr.setRequestHeader("Content-Type","application/x-www-form-urlencode");
xhr.onreadystatechange = function () {
if(xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 304)) {
fn.call(this, xhr.responseText)
}
}
xhr.send(data)
}