Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Seguinte Gelera, queria saber como faria para usar este código no modo GET e normal , atualmente só consigo usar em uma função ou na outra.
O código não é de minha autoria , não sei quase de sobre o mesmo , e estou pedindo a ajuda de vocês é acho que o site com a paginação em ajax fica mais atraente.
<script>
function ajaxInit(){
var xmlhttp;
try{ xmlhttp = new XMLHttpRequest(); }
catch(ee) {
try{ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); }
catch(e) {
try{ xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); }
catch(E){ xmlhttp = false ; }
}
}
return xmlhttp;
}
function carregar(pagina, local){
$(local).html('<img src="img/loading.gif" class="gif_load" width="126" height="22" />');
ajax = ajaxInit();
if(ajax){
ajax.open('POST', 'geral_ver.php?ID=', true);
ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
ajax.onreadystatechange = function(){
if(ajax.readyState == 4){
$(local).html('<img src="img/loading.gif" class="gif_load" width="126" height="22" />');
if(ajax.status == 200){ $(local).html(ajax.responseText); }
}
}
ajax.send('pg='+pagina);
}
}
$(document).ready(function(){
$('a.link-ajax').click(function(e){ carregar(this.id, '#ajax_div'); });
});
</script>Carregando comentários...