Commit 27a8a8a9 authored by David Garner's avatar David Garner
Browse files

merged

parents ecb78e22 ad070422
......@@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<title>booksLibrary</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="library.js"></script>
<script src="booksLibrary.js"></script>
</head>
......
/**
* Created by matthewburket on 2/22/16.
*/
jQuery(function() {
var i, j, lib, table, currentShelf, currentBook;
lib = new Library("Iowa State");
i = 0;
while (i < 3) {
lib.addShelf(new Shelf("Shelf" + i));
j = 0;
while (j < 10) {
lib.shelves[i].addBook(new Book("Book" + j));
j++;
}
i++;
}
table = "";
table += "<table>";
for(i = 0; i < lib.shelves.length; i++) {
table += "<tr>";
currentShelf = lib.shelves[i];
table +="<th>";
table += "Shelf" + i;
table += "</th>";
for(j = 0; j < currentShelf.books.length; j++) {
currentBook = currentShelf.books[j];
table += "<td>";
table += currentBook.name;
table += "</td>";
}
table += "</tr>"
}
table += "</table>";
$('body').append(table);
});
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment