function ajax(url){
var send_data='a=123&b=231$c=232'; //sender data in string type
var request;
if(window.XMLHttpRequest){
request = new XMLHttpRequest();
}else if(window.ActiveXObject){
request = new ActiveXObject("Microsoft.XMLHTTP");
}else{
return;
}
request.onreadystatechange = function(){
switch (request.readyState){
//case 1,2,3for event while request sent on server
case 1: document.getElementById('input_rubrics').innerHTML='<div class="loading_processing"><div></div></div>';break;
case 2: document.getElementById('input_rubrics').innerHTML='<div class="loading_processing"><div></div></div>';break;
case 3: document.getElementById('input_rubrics').innerHTML='<div class="loading_processing"><div></div></div>';break;
case 4:{
if(request.status==200){
document.getElementById('input_rubrics').innerHTML=request.responseText;
}else if(request.status==404){
alert("Ошибка: запрашиваемый скрипт не найден!");
}
else alert("Ошибка: сервер вернул статус: "+ request.status);
break;
}
}
}
request.open("POST",url, true);
request.setRequestHeader('Content-type',"application/x-www-form-urlencoded");
request.send(send_data);
};