Guest User

Untitled

a guest
May 23rd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. var dados = $(this).serialize();
  2.  
  3. success: function(data) {
  4. alert("Sucesso!")
  5. }
  6.  
  7. $(document).ready(function() {
  8. $("#formPost").submit(function() {
  9. var dados = $(this).serialize();
  10. console.log(dados);
  11. $.ajax({
  12. type: 'POST',
  13. url: 'https://jsonplaceholder.typicode.com/posts',
  14. data: JSON.stringify(dados),
  15. success: function(data) {
  16. alert("Sucesso!")
  17. }
  18. });
  19. return false;
  20. });
  21. });
Add Comment
Please, Sign In to add comment