If you are like me, that is, do not like jQuery and do not use it or pay you, here is another way:
<script type="text/javascript" charset="utf-8">
function ajaxObj(meth, url) {
var x;
try {x=new XMLHttpRequest();}
catch(e) {var XmlHttpVersions=new Array("MSXML2.XMLHTTP.6.0", "MSXML2.XMLHTTP.5.0", "MSXML2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP");for (var i=0; i<XmlHttpVersions.length && !x; i++){try { x=new ActiveXObject(XmlHttpVersions[i]);} catch (e){}}
};
if (!x){displayError("Erro ao criar o objeto XMLHttpRequest.");} else {x.open(meth, url, true);x.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); x.setRequestHeader("Cache-Control", "no-cache");x.setRequestHeader("Pragma", "no-cache");x.setRequestHeader("X-Requested-With", "XMLHttpRequest");return x;}};
function ajaxReturn(x){if(x.readyState==4 && x.status==200){return true;}
}
</script>
<script type="text/javascript" charset="utf-8">
function _(x){ return document.getElementById(x);}
</script>
<script type="text/javascript" charset="utf-8">
function pc(oquepost,pagesc){
if(typeof(oquepost) !== 'undefined'){
var name = oquepost;
}else{
var div1 = document.getElementById('artigo');
var name = div1.getAttribute("data-postid");
};
if(typeof(pagesc) !== 'undefined'){var pagec = pagesc;} else {var pagec = null;};
var vars = 'procuraralgo='+name+'&pagina='+pagec;
var url = "arquivo_procurador.php";
var ajax = ajaxObj("POST",url,true);
ajax.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
ajax.onreadystatechange = function() {
if(ajaxReturn(ajax) == true) {
var return_data = ajax.responseText;
_("artigo").innerHTML = return_data;}
};
ajax.send(vars);
_("artigo").innerHTML = "A processar os dados...";
}
</script>
I hope it helps!