Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. function miFuncion() {
  7. var fewSeconds = 5;
  8.  
  9.  
  10. $("#enviarBoton").prop("disabled", true);
  11. $("#enviarBoton").css("opacity", "0.3");
  12.  
  13.  
  14. $.ajax({
  15. method: "post",
  16. contentType: "application/json",
  17. url: "cogerRespuesta",
  18. data: JSON.stringify({"nombre": $("#nombre").val()}),
  19. dataType: 'json',
  20. success: function (datos) {
  21. alert(datos.nombre);
  22. setTimeout(function () {
  23. $("#enviarBoton").prop("disabled", false);
  24. $("#enviarBoton").css("opacity", "1");
  25. }, fewSeconds * 1000);
  26.  
  27. //$("#muestraTexto").html(datos.nombre);
  28. $("#muestraTexto").load("prueba.xml");
  29. },
  30. error: function (e) {
  31. console.log("ERROR " + e);
  32. }
  33. });
  34. return false;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement