Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getListItems(jsonURL) {
- $.getJSON(jsonURL, null, function (data) {
- if ('items' in data) {
- var items = data.items;
- var resultMap = {};
- for (var itemCount = 0; itemCount < items.length; itemCount++) {
- (function (itemCount) {
- var item = items[itemCount];
- console.log(item);
- $.get('listItem.html', function (html) {
- var listItem = $($.parseHTML(html));
- listItem.css("background-image", "url(" + item.image + ")");
- resultMap[itemCount] = listItem;
- });
- })(itemCount);
- }
- }
- }
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement