jeudi 4 juin 2020

getting entire json data from API with AJAX

With my AJAX call, I want to get the json data entirely.

For example www.abc.com/api/3 gives {"information":.... json data with many levels...}}

I want to store this data in variable.So I try this:

$.ajax({
            async: false,
            type: 'GET',
            dataType: 'json',
            url: url,
            data: data,
            success: function(data) {

                               x=data;// It's wrong, but I don't know how to put whole json into x

            }
        })



Aucun commentaire:

Enregistrer un commentaire