PageSourceSearch

https://pizzariafelicita.com.br/assets/js/ajaxForm.js

js pizzariafelicita.com.br collected 2026-09-24 14:34:57 UTC 3,269 bytes, 60 lines download raw bytes

1jQuery(function() {
2    $('.ajaxForm').on('submit', function(event) {
3        if ($(this).valid()) {
4            var form = $(this);
5            event.preventDefault();
6            if ($('#keycode').val() === $('#keycode_valor').val()) {
7
8                var formData = new FormData($(this)[0]);
9
10                form.find('input[type=submit], button[type=submit]').attr('disabled', 'disabled');
11                form.find('input[type=submit], button[type=submit]').css('opacity', '0.3');
12                form.find('.alerta').remove();
13                form.find('input[type=submit], button[type=submit]').after('<div class="ajaxForm-alert ajaxForm-alert--loading">Aguarde...</div>');
14
15                setTimeout(function() {
16                    $.ajax({
17                        type: "POST",
18                        enctype: 'multipart/form-data',
19                        async: false,
20                        crossDomain: true,
21                        url: "/" + $CLIENTE + "/contato",
22                        data: formData,
23                        error: function(XMLHttpRequest, textStatus, errorThrown) {
24                            // alert("Erro ao carregar dados. Por favor tente novamente mais tarde.");
25                            console.log(XMLHttpRequest + '-' + textStatus + '-' + errorThrown);
26                            form.find('.ajaxForm-alert').remove();
27                            form.find('input[type=submit], button[type=submit]').after('<div class="ajaxForm-alert ajaxForm-alert--error">Erro no envio da mensagem</div>');
28                        },
29                        success: function(retorno) {
30                            console.log(retorno);
31                            if (retorno.success) {
32                                form.find('.ajaxForm-alert').remove();
33                                form.find('input[type=submit], button[type=submit]').after('<div class="ajaxForm-alert ajaxForm-alert--sucess">Mensagem enviada!</div>');
34                            } else {
35                                form.find('.ajaxForm-alert').remove();
36                                form.find('input[type=submit], button[type=submit]').after('<div class="ajaxForm-alert ajaxForm-alert--error">Erro no envio da mensagem</div>');
37                            }
38                        },
39                        beforeSend: function() {
40                            console.log('beforeSend');
41                        },
42                        complete: function() {
43                            form[0].reset();
44                            form.find('input[type=submit], button[type=submit]').removeAttr('disabled');
45                            form.find('input[type=submit], button[type=submit]').css('opacity', '1');
46                        },
47                        cache: false,
48                        contentType: false,
49                        processData: false
50                    });
51                }, 100);
52            } else {
53                $('#captchaError').remove();
54                $('#keycode').parent().append('<label id="captchaError" for="keycode" class="error">Preencha o captcha corretamente!</label>')
55                $('#captchaError').css('display', 'block');
56            }
57        }
58        return false;
59    });
60});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.