Retrieve data from JSON file and display images in a gallery

后端 未结 3 1965
既然无缘
既然无缘 2021-01-01 07:51

I\'m new to JQuery and any help would be much appreciated.

\"Using $.getJSON function, retrieve the data in the items.json file provided and display the images in a

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-01 08:01

    If you want to show just img use this(I used div with id="images")

     $(document).ready(function() {
    
                $.getJSON('items.json', function(data) {
                    $.each(data.items, function(i, f) {
                        $("#images").append("");
    
                    });
                });
            }); 
    

提交回复
热议问题