31
| <![CDATA[<script type="text/javascript">
$(document).ready(function() {
var form = $('#form');
var submit = $('#submit');
var alert = $('.alert');
var alertSucesso = $('.alert.alert-success');
var alertErro = $('.alert.alert-warning');
alert.hide();
form.submit(function(e){
e.preventDefault();
$.ajax({
url: 'assets/plugins/email.php',
type: 'POST',
data: form.serialize(),
beforeSend: function() {
alert.fadeOut();
submit.html('Enviando...');
},
success: function(data) {
alertSucesso.show();
form.trigger('reset');
submit.html('Enviar');
},
error: function(e) {
alertErro.show();
console.log(e);
}
})
});
});
</script>]]>
|