jQuery Ajax

jQuery Ajax

December 29, 2022
jQuery("text.learn_more_title").click(function () {
    jQuery.ajax({
        url: 'api_endpoint',
        type: 'POST',
        dataType: 'JSON',
        crossorigin: true,
        data: {
            'customer_id': 'CustomerId',
            'id': 'asset_id'
        },
        crossorigin: true,
        xhrFields: {
            withCredentials: true
        },
        beforeSend: function (xhr) {
            xhr.setRequestHeader("Authorization", 'api_token')
        },
        error: function (e) {

        },
        success: function (res) {

            console.log(res);
        },
        complete: function () {

        }
    });
});

 

Leave A Comment

Avada Programmer

Hello! We are a group of skilled developers and programmers.

Hello! We are a group of skilled developers and programmers.

We have experience in working with different platforms, systems, and devices to create products that are compatible and accessible.