manusoftar

ajax attempt

Sep 8th, 2013
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function verifyName(name,mbox){
  2.          if (name.length == 0){
  3.              callback(false);
  4.              return;
  5.          }
  6.          //var ajax = getAJAX();
  7.          //ajax.open("GET","http://www.smon.com.ar/php/query.php?T=0&V="+name);
  8.          //ajax.send();
  9.          
  10.          $.get("http://www.smon.com.ar/php/query.php",{ T : 0, V : name}, function(respuesta){
  11.                                                              console.log("AJAX realizado!");
  12.                                                              if (respuesta=="1"){
  13.                                                                  //mbox.innerHTML="El nombre de usuario igresado ya está registrado, o bien"+
  14.                                             " dejó el campo vacío";
  15.                               mbox.style.visibility="visible";
  16.                                                                  alert("AJAX listo!");     
  17.                                                                  callback(true);
  18.                                                              } else {
  19.                                                                  callback(false);
  20.                                                                  //mbox.style.visibility="hidden";
  21.                                                                  alert("AJAX listo!"); 
  22.                                                              }
  23.                                                       });
  24. }
Advertisement
Add Comment
Please, Sign In to add comment