How to get JSON data from the URL (REST API) to UI using jQuery or plain JavaScript?

后端 未结 4 2015
悲哀的现实
悲哀的现实 2021-02-04 08:26

I have a URL \"http://localhost:8888/api/rest/abc\" which will give following json data. I wants to get this data in my UI using Jquery or java script. I\'m trying

4条回答
  •  悲哀的现实
    2021-02-04 09:01

     jquery.ajax({
                url: `//your api url`
                type: "GET",
                dataType: "json",
                success: function(data) {
                    jQuery.each(data, function(index, value) {
                            console.log(data);
                            `All you API data is here`
                        }
                    }
                });     
    

提交回复
热议问题