Guest User

Untitled

a guest
Jan 22nd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. <script type="text/javascript">
  2. $(document).ready(function(){
  3. $("#formulario").on("submit", function(e){
  4. e.preventDefault();
  5. var cdb = $("#cdb").val();
  6. $.ajax({
  7. url: "confere.php",
  8. method: "POST",
  9. dataType: "html",
  10. data: {cdb: cdb}
  11. }).done(function(data){
  12. $("#cdb").val("");
  13. $("#cdb").focus();
  14. listar();
  15. }).fail(function(data){
  16. alert("Erro");
  17. });
  18. });
  19. });
  20. function listar() {
  21. $.ajax({
  22. url:"lista.php",
  23. success: function (textStatus) {
  24. $('#lista').html(textStatus);
  25. }
  26. });
  27. }
  28. </script>
Add Comment
Please, Sign In to add comment