Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var dados = $(this).serialize();
- success: function(data) {
- alert("Sucesso!")
- }
- $(document).ready(function() {
- $("#formPost").submit(function() {
- var dados = $(this).serialize();
- console.log(dados);
- $.ajax({
- type: 'POST',
- url: 'https://jsonplaceholder.typicode.com/posts',
- data: JSON.stringify(dados),
- success: function(data) {
- alert("Sucesso!")
- }
- });
- return false;
- });
- });
Add Comment
Please, Sign In to add comment