showing results for - "get alert after using ajax"
Roberto
22 Jul 2018
1<script>
2
3    $(function () {
4        $("#myForm").submit(function (evenr) {
5            event.preventDefault(e);
6            var form_data = $(this).serialize();
7            $.ajax({
8                url:'mail.php',
9                method:'POST',
10                data:{data},
11                success:function(data){
12                    alert(data);
13                    if($.trim(data))
14                     {
15                     alert("Mail was sent !")
16                    $("#success_message").attr("style", "display: none");
17                     }else{ alert("Mail was not sent !")}
18                }
19            });
20        });
21    });
22
23</script>
24