From 4b63b00c32b767d24b114d38dab8c154d6321a7b Mon Sep 17 00:00:00 2001 From: RossTheRoss Date: Mon, 22 Mar 2021 13:24:16 -0500 Subject: Start Extra credit --- csci4131/hw5/strap012_hw5/client/contacts.html | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'csci4131/hw5/strap012_hw5/client/contacts.html') diff --git a/csci4131/hw5/strap012_hw5/client/contacts.html b/csci4131/hw5/strap012_hw5/client/contacts.html index 2e4bf65..15e4032 100755 --- a/csci4131/hw5/strap012_hw5/client/contacts.html +++ b/csci4131/hw5/strap012_hw5/client/contacts.html @@ -23,19 +23,16 @@ var contacts = a.contacts; for (let i = 0; i < contacts.length; i++) { var contact = contacts[i]; - var row = table.insertRow(-1); - var nam = row.insertCell(0); - nam.innerHTML = contact.name; - var cat = row.insertCell(1); - cat.innerHTML = contact.category; - var loc = row.insertCell(2); - loc.innerHTML = contact.location; - var con = row.insertCell(3); - con.innerHTML = contact.contact; - var ema = row.insertCell(4); - ema.innerHTML = contact.email; - var url = row.insertCell(5); - url.innerHTML = "" + contact.website_url + ""; + var row = table.insertRow(); + for (var j in contact) { + if (j != "website_url") { + var value = row.insertCell(); + value.innerHTML = contact[j]; + } else { + var url = row.insertCell(); + url.innerHTML = "" + contact[j] + ""; + } + } } } -- cgit v1.2.3