Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

complete ajax request jquery php call | ajax request

<script type="text/javascript">
    function ajaxCall(formID, showID) {
        var form = $('#' + formID);
        $.ajax({
            type: form.attr('method'),
            url: form.attr('action'),
            data: form.serialize(),
            dataType: "JSON",
            cache: false,
            success: function (data, status, xhr) {
                $('#' + showID).html('').fadeOut('fast');
                $('#' + showID).html(data).fadeIn('slow');
            },
            error: function (xhr, status, error) {
                //alert(xhr);
                console.error(xhr);
            }
        });
    }
</script>
Comment

PREVIOUS NEXT
Code Example
Javascript :: How to add a class to html element js 
Javascript :: regex char or char 
Javascript :: boucle foreach js 
Javascript :: typeof in js 
Javascript :: Expected the depth of nested jsx elements to be <= 2, but found 3 
Javascript :: dull or blur a background image in react native 
Javascript :: javascript select option based on text 
Javascript :: check if element with class has another class javascript 
Javascript :: nodejs create stream 
Javascript :: mongoose encrypt password 
Javascript :: render image in vue 
Javascript :: jquery validation from data 
Javascript :: overflowy 
Javascript :: add class to element vue 
Javascript :: if js 
Javascript :: javascript loop 
Javascript :: random number generatoe js 
Javascript :: doughnut chartjs with react display percentage 
Javascript :: while loop in javascript 
Javascript :: import npm dotenv package 
Javascript :: what is asynchronous in javascript 
Javascript :: component will unmount 
Javascript :: jquery ajax methods 
Javascript :: vue cli debugger 
Javascript :: console.log() Print a Sentence 
Javascript :: extract text from a string javascript 
Javascript :: jQuery intellisence in VSCode 
Javascript :: javascript days until end of month 
Javascript :: js promise 
Javascript :: GET method firebase realtime database react 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =