Advertisement
Guest User

mefi2book_index_array_bug

a guest
Jul 29th, 2015
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // build index in html
  2.             logger("Building Index HTML");
  3.             var htmlIndex = "",
  4.                 indexItem = "",
  5.                 len = userNames.length;
  6.                 logger("userNames.length is: "+len);
  7.                 logger("(this is used to limit the counter for the indexing loop and should not be 0)");
  8.             for ( var i=0; i<len; i++) {
  9.                 logger("Indexing Item");
  10.                 indexItem = "<div class='indexItem'><span class='indexItemName'>"+userNames[i]+"</span> ";
  11.                 var userPagesArray = userIndex[userNames[i]];
  12.                 for (var j=0;j<userPagesArray.length;j++) {
  13.                     indexItem = indexItem + userPagesArray[j] + ", ";
  14.                 console.log("IndexItem: "+indexItem);
  15.                 }
  16.                 htmlIndex = htmlIndex + indexItem.substr(0,indexItem.length-2) + "</div>";
  17.             }
  18.             console.log("htmlIndex contents: "+htmlIndex);
  19.             logger("Invoking buildFinalPDF with htmlIndex");
  20.             buildFinalPDF(htmlIndex);
  21.             }
  22.         });
  23.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement