Difference between revisions of "Team:Purdue/Navpage"

Line 16: Line 16:
 
var entryBlocks = [];
 
var entryBlocks = [];
 
Main();
 
Main();
 +
 +
function createLinkTag(obj,index){
 +
obj.Url_name.sort();
 +
obj.Url_name.forEach(function(objec,index){
 +
var temp = objec.split(",",1)
 +
var as =  document.createElement("a");
 +
as.href=temp[1];
 +
as.innerHTML=temp[0];
 +
obj.a.push(as)
 +
});
 +
});
 +
 +
 +
 
  function Main(){
 
  function Main(){
  
Line 40: Line 54:
  
 
function arrayToList(){
 
function arrayToList(){
  entryBlocks.forEach(function(obj,index){
+
  entryBlocks.forEach(createLinkTag(obj,index));
obj.Url_name.sort();
+
obj.Url_name.forEach(function(objec,index){
+
var temp = objec.split(",",1)
+
var as =  document.createElement("a");
+
as.href=temp[1];
+
as.innerHTML=temp[0];
+
obj.a.push(as)
+
});
+
});
+
 
}
 
}
 +
 
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

Revision as of 14:01, 13 June 2018

Bootstrap Example