I am trying to create an Index for my blog. I want to show a different page for different letters. For eg, In "Page A", I want to show all the labels starting with "A" ONLY. Then "Page B", "Page 0" etc.
I have figured out a code which gives out all the lists in the site:
function cat(json){ //get categories of blog & sort them
var label = json.feed.category;
var lst=[];
for (i=0; i<label.length; i++){
lst[i] = label[i].term ;
document.getElementById("listspan").innerHTML = document.getElementById("listspan").innerHTML + "<a href=\"/search/label/" + label[i].term + "\">" + label[i].term + "</a><br>"
}
}
<span id="listspan"></span>
<script src="http://www.chordzone.org/feeds/posts/summary?alt=json&max-results=0&callback=cat">
</script>
The issue that I'm facing is that the page crashes due to the large amount of labels.
Is there any way that I can reduce the load on the page, so that only labels starting with "A" or "B" etc., can be shown. Is it possible to sort the labels alphabetically during the json call and show only the required labels, rather than calling all the labels in the site at once?
Any help is appreciated.