Line 25: | Line 25: | ||
var charCode = 65; | var charCode = 65; | ||
for(i = 0; i<26; i++){ | for(i = 0; i<26; i++){ | ||
− | entryBlocks[i]= letterEntry(String.fromCharCode(charCode)); | + | entryBlocks[i]= new letterEntry(String.fromCharCode(charCode)); |
} | } | ||
arrayToList(); | arrayToList(); | ||
//now a tags are made, time to place them in an unordered list | //now a tags are made, time to place them in an unordered list | ||
− | + | atagsInList(); | |
} | } | ||
Line 45: | Line 45: | ||
function arrayToList(){ | function arrayToList(){ | ||
var obj; | var obj; | ||
− | + | var temp; | |
− | + | ||
var subObj; | var subObj; | ||
− | for ( | + | var as; |
+ | for (i = 0; i < len(entryBlocks); i++){ | ||
+ | entryBlocks[i].Url_name.sort(); | ||
− | + | for (k = 0; k < len(entryBlocks[i].Url_name); k++){ | |
− | + | temp = entryBlocks[i].Url_name[k].split(",",1); | |
+ | as = document.createElement("a"); | ||
as.href=temp[1]; | as.href=temp[1]; | ||
as.innerHTML=temp[0]; | as.innerHTML=temp[0]; | ||
Line 61: | Line 63: | ||
function atagsInList(obj,Index){ | function atagsInList(obj,Index){ | ||
//takes the link tags and adds them to a list | //takes the link tags and adds them to a list | ||
− | + | var list_item; | |
− | + | for (i=0; i < len(entryBlocks); i++){ | |
− | + | entryBlocks[i].ulList = document.createElement("ul"); | |
− | list_item.appendChild( | + | for (k=0; k < len(entryBlocks[i].a);k++){ |
− | + | obj.(function(obje,index){ | |
+ | list_item = document.createElement("li"); | ||
+ | list_item.appendChild(entryBlocks[i].a[k]); | ||
+ | entryBlocks[i].ulList.appendChild(list_item); | ||
}); | }); | ||
− | + | document.getElementById("div").appendChild(entryBlocks[i].Header); | |
− | document.getElementById("div").appendChild( | + | document.getElementById("div").appendChild(entryBlocks[i].ulList); |
} | } | ||
Revision as of 16:30, 13 June 2018