Link to home
Start Free TrialLog in
Avatar of Rohit Bajaj
Rohit BajajFlag for India

asked on

Convert jquery ajax call to pure javascript

HI,
I am currently using jquery to make an ajax call :
$.ajax({
        url: url,
        type: 'POST',
        contentType: 'application/json',
        headers: {
            'X-hfh': this.data
        },
        dataType: 'json',
        success: function(result) {
            $.each(result, function(idx, item) {
                mybuddyList.push({
                    DisplayText: item.name,
                    JID: item.id,
                    ImageURL: item.profileImage
                });
            });
        },
        error: function() {
            console.log("Error");
        }
    });

Open in new window

I want to get rid of jquery and use only javascript to achieve the same.
How do i do it.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Kim Walker
Kim Walker
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial