Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

calling a java function onClick with ajax

<script type="text/javascript">
        $(document).ready(function() {
            $('#sendMailBtn').click(function (){
                $.ajax({
                    type: "post",
                    url: "/path", 
                    data: "email=" + $('#email').val() + "&subject="+$('#subject').val() + "&msg=" + $('#msg').val(),
                    success: function(msg){      
                        //
                    }
                });
            });
        });
 </script>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #calling #java #function #onClick #ajax
ADD COMMENT
Topic
Name
7+2 =