Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

get alert after using ajax

<script>

    $(function () {
        $("#myForm").submit(function (evenr) {
            event.preventDefault(e);
            var form_data = $(this).serialize();
            $.ajax({
                url:'mail.php',
                method:'POST',
                data:{data},
                success:function(data){
                    alert(data);
                    if($.trim(data))
                     {
                     alert("Mail was sent !")
                    $("#success_message").attr("style", "display: none");
                     }else{ alert("Mail was not sent !")}
                }
            });
        });
    });

</script>
Comment

PREVIOUS NEXT
Code Example
Javascript :: change text of span js html 
Javascript :: update node js mac to latest version 
Javascript :: javascript div id add class 
Javascript :: how to connect metamask wallet with js 
Javascript :: jquery populate select from json 
Javascript :: javascript for each key in object 
Javascript :: discord.js leave guild 
Javascript :: Finding the array element: 
Javascript :: javascript regex url 
Javascript :: angular string to number 
Javascript :: js upload file dialog 
Javascript :: onload set scroll on top of page jquery 
Javascript :: find min and max date in array javascript 
Javascript :: match date regex 
Javascript :: install electron 
Javascript :: nodejs get response time 
Javascript :: iframe in angular 
Javascript :: get value from another textinput and set is to another using jquery 
Javascript :: jquery enable textbox 
Javascript :: js string to date 
Javascript :: location.reload sweetalert 
Javascript :: add value to the top of an array in js 
Javascript :: get two-digit hex from number javascript 
Javascript :: how to store array into react-native local storage 
Javascript :: 413 payload too large nodejs 
Javascript :: how to creat a function 
Javascript :: jquery change selected option 
Javascript :: redirect to html page in javascript 
Javascript :: javascript get x,y point on circle 
Javascript :: javascript regex escape forward slash 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =