Last active
December 19, 2015 21:29
-
-
Save AngeloMerlo/6020716 to your computer and use it in GitHub Desktop.
DRY - Ajax usando jQuery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Não repita a si mesmo - Ajax usando jQuery | |
// -------------------------------------------- | |
$('input').click(function(){ | |
$.ajax({ | |
url : 'controle.php', | |
type : 'post', | |
data : {'dado':valor}, | |
beforeSend: function(){ | |
$('#carregando').fadeIn(); | |
}, | |
timeout: 3000, | |
success: function(retorno){ | |
$('#resposta').html(retorno); | |
}, | |
error: function(erro){ | |
$('#resposta').html(erro); | |
} | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment