Código HTML:
<script> var request = false; if (window.XMLHttpRequest) { request = new XMLHttpRequest(); } function checkName(nick,clave) { if (window.ActiveXObject) { try { request = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { request = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { request = false; } } } if (request) { request.onreadystatechange = processReqChange; request.open("GET", "check.php?nk="+nick+"&cl="+clave); request.send(null); } } function processReqChange() { var result = document.getElementById("result"); if (request.readyState == 4) { if (request.status == 200) { result.innerHTML = request.responseText; } } else { result.innerHTML = "Espere, procesando los datos ..."; } } </script> <style type="text/css"> <!-- .result { background-color: #BBFBBD; border: 1px solid #006600; } --> </style> <form name="form1" method="post" action="" onSubmit="checkName(form1.ni.value,form1.cl.value)"> Nick:<br> <input name="ni" type="text" id="ni"> <br> Clave:<br> <input name="cl" type="text" id="cl"> <br> <input type="submit" name="Submit" value="Entrar"> </form> <div class="result" id="result"></div>
Yo quiero que se quede escrito y no desaparesca.
Ah por sierto, soy nuevo en ajax
Gracias
Salu2