Ver Mensaje Individual
  #31 (permalink)  
Antiguo 23/09/2005, 16:27
Avatar de xknown
xknown
 
Fecha de Ingreso: diciembre-2004
Ubicación: Cusco - Perú
Mensajes: 2.248
Antigüedad: 19 años, 4 meses
Puntos: 7
Cita:
Iniciado por MaBoRaK
No programé en ASP pero :D
no deberia ser == en vez de =?
No

En la función que envian anteriormente no veo la necesidad de crear cada vez que se llama a la función enviar el objeto objetus, pongo un ejemplo en el que no sucede el "error" que mencionan (al menos para mi)
Código HTML:
<?php
	header ("Content-type: text/html; charset=iso-8859-1;");
	if (isset($_REQUEST['pwd'])) {
		$pwd = $_REQUEST['pwd'];
		echo $pwd;
		exit;
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
	
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>Ajax demo</title>
<script>	
var xmlhttp=false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation, we can cope with old IE versions.
// and security blocked creation of the objects.
 try {
  xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
 } catch (e) {
  try {
   xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (E) {
   xmlhttp = false;
  }
 }
@end @*/

if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  xmlhttp = new XMLHttpRequest();
}

function doIt(){
	if ( !xmlhttp ) return true;
	text = "?pwd="+escape(document.getElementById('pwd').value);
	xmlhttp.open("GET", "ajax-test.php"+text, true);
	xmlhttp.setRequestHeader('Connection', 'close');	
	
	xmlhttp.onreadystatechange=function() {
		if (xmlhttp.readyState==4) {
			   alert(xmlhttp.responseText)
		}
	}

	xmlhttp.send(null);
	return false;
}
</script>
</head>

<body>

<form name="frm" id="frm" action="ajax-test.php" method="post">
<p><textarea id="pwd" name="pwd" rows="7" cols="15">
</textarea></p>
<p><input type="submit" name="send" id="send" value="Enviar" onclick="return doIt();" /></p>
</form>

</body>
</html> 
Pueden ver un demo en http://test.buayacorp.com/ajax-test.php

Saludos
__________________
Alex Concha
Buayacorp - Programación y Diseño