Ver Mensaje Individual
  #4 (permalink)  
Antiguo 07/04/2011, 20:52
Avatar de laratik
laratik
 
Fecha de Ingreso: mayo-2010
Ubicación: Cali
Mensajes: 317
Antigüedad: 13 años, 11 meses
Puntos: 63
Respuesta: Captar datos de tablas y mostrarlos

si estoy bien enfocado, lo que deseas es algo como esto:

Código HTML:
<html> 
<head> 

<script>
function getXMLHttpRequest() {
	var xmlHttp;
	try {
		xmlHttp = new XMLHttpRequest();
	} catch(e1) {
		try {
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch(e2) {
			try {
				xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
			} catch(e3) {
				xmlHttp = null;
			}
		}
	}
	return xmlHttp;
}

function requestAJAX(id) {
	var xmlHttp = getXMLHttpRequest();
	xmlHttp.onreadystatechange = function() {
		if (xmlHttp.readyState == 4) {
			var r = xmlHttp.responseText;
			document.getElementById("mostrar").innerHTML = r;
		}
	};
	xmlHttp.open("POST", "prueba.php", true);
	xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	xmlHttp.send("dato="+id);
} 
</script> 
</head> 
<body> 
<table border="1">
	<tr onClick="requestAJAX('dato1')">
    	<td>Dato1</td><td>Dato1</td><td>Dato1</td><td>Dato1</td><td>Dato1</td><td>Dato1</td>
    </tr>
    <tr onClick="requestAJAX('dato2')">
    	<td>Dato2</td><td>Dato2</td><td>Dato2</td><td>Dato2</td><td>Dato2</td><td>Dato2</td>
    </tr>
</table>
<div id="mostrar"></div>
</body> 
</html> 
__________________
Programar apasiona y lo que apasiona es un arte, por lo tanto programar es un arte.

Quiero karma para en mi próxima vida ser un billonario bien dotado con alas.