-
Notifications
You must be signed in to change notification settings - Fork 0
/
contato.js
31 lines (27 loc) · 894 Bytes
/
contato.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/**
* Created by hermes on 16/10/14.
*/
var contatourl = endereco + "contato/";
$(document).on('pagebeforeshow', '#contato', function() {
$(document).on('submit', '#contatofrm', function(e) {
e.preventDefault();
postForm();
});
function postForm()
{
$.ajax({
type: $('form').attr('method'),
url: contatourl,
data: $('form').serialize(),
dataType: 'json',
success: function(data) {
alert("Mensagem enviada com sucesso. Iremos retornar para o seu e-mail, fique atento(a).");
},
error: function (xhr, ajaxOptions, thrownError) {
alert("Error: " + xhr.status + "\n" +
"Message: " + xhr.statusText + "\n" +
"Response: " + xhr.responseText + "\n" + thrownError);
}
});
}
});