Código Javascript
:
Ver originalfunction class_ajax(valor)
{
var url = "../logica/mi_pagina.php?id="+valor;
http = false;
if (window.XMLHttpRequest) //firefox y safari
{
http = new XMLHttpRequest();
if (http.overrideMimeType)
{
http.overrideMimeType('text/xml');
}
}
else if (window.ActiveXObject) // internet esplorer
{
try {
http = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
http.onreadystatechange = function (){
if(http.readyState == 4)
{
if (http.status == 200) {
result_ajax = http.responseText;
alert('result_ajax')
}else{
alert('connection failed');
}
}
}
http.open('GET',url , true);
http.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
http.send(null);
}
}
puedes mandar variables por GET o POST