Note that there are some explanatory texts on larger screens.

plurals
  1. PODifficulty in loading multiple images in a list view served by multiple xml files
    primarykey
    data
    text
    <p>I am developing a html application for Android and I am trying to load images in a list view. Data specific to list items is being served by multiple xml files. I am using ajax to load xml files and populate the list items. Problem I am facing here is that there are 164 list items. Hence, 164 images and 10 xml files to load. my loader function exhausts after two iterations. It does read the xml files but it's unable to dynamically create list items and populate them with images after two iterations. I believe it's due to stack limitations. I can't think of alternate solution. If somebody could suggest an alternate solution that will be highly appreciated. Below is my loader function. It's a recursive function:</p> <pre><code>function loadChannels() { $.ajax({ type: "GET", url: curURL, dataType: "xml", error: function(){ console.log('Error Loading Channel XML'); }, success: function(nXml) { var noOfItems = parseInt($($(nXml).find('total_items')[0]).text(), 10); var startIdx = parseInt($($(nXml).find('item_startidx')[0]).text(), 10); var allItems = $(nXml).find('item'); $(allItems).each(function() { var obj = $("&lt;li&gt;&lt;span id='cont-thumb'&gt;&lt;/span&gt;&lt;span id='cont-name'&gt;&lt;/span&gt;&lt;/li&gt;"); $("#content-scroller ul").append($(obj)); var imgURL = $($(this).find('item_image')[0]).text(); var contThumb = $(obj).children()[0]; $(contThumb).css("background-image", 'url('+imgURL+')'); var name = $($(this).find('name')[0]).text(); var contName = $(obj).children()[1]; $(contName).text(name).css('text-align', 'center'); var url = $($(this).find('link')[0]).text(); $(obj).data('item_link', url); $(obj).bind('click', onJPContSelected); }); if(startIdx+allItems.length &lt; noOfItems){ var newIdx = new Number(startIdx+allItems.length); var tokens = curURL.split("/"); tokens[tokens.length-2] = newIdx.toString(10); curURL = "http:/"; for(var i=2; i&lt;tokens.length; i++) curURL = curURL + "/" + tokens[i]; loadChannels(); } } }); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload