aboutsummaryrefslogtreecommitdiffstats
path: root/OLD/csci4131/hw7/public/contacts_old.html
diff options
context:
space:
mode:
authorMatt Strapp <matt@mattstrapp.net>2022-05-24 11:18:46 -0500
committerMatt Strapp <matt@mattstrapp.net>2022-05-24 11:19:55 -0500
commit7a73162607544204032aa66cce755daf21edebda (patch)
tree58578e01f15f34a855d99c32898db9d7a1603e67 /OLD/csci4131/hw7/public/contacts_old.html
parentdo some stuff (diff)
downloadhomework-7a73162607544204032aa66cce755daf21edebda.tar
homework-7a73162607544204032aa66cce755daf21edebda.tar.gz
homework-7a73162607544204032aa66cce755daf21edebda.tar.bz2
homework-7a73162607544204032aa66cce755daf21edebda.tar.lz
homework-7a73162607544204032aa66cce755daf21edebda.tar.xz
homework-7a73162607544204032aa66cce755daf21edebda.tar.zst
homework-7a73162607544204032aa66cce755daf21edebda.zip
Graduate
Signed-off-by: Matt Strapp <matt@mattstrapp.net>
Diffstat (limited to 'OLD/csci4131/hw7/public/contacts_old.html')
-rw-r--r--OLD/csci4131/hw7/public/contacts_old.html82
1 files changed, 0 insertions, 82 deletions
diff --git a/OLD/csci4131/hw7/public/contacts_old.html b/OLD/csci4131/hw7/public/contacts_old.html
deleted file mode 100644
index d0131ee..0000000
--- a/OLD/csci4131/hw7/public/contacts_old.html
+++ /dev/null
@@ -1,82 +0,0 @@
-<html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
- <script type="text/javascript" defer>
- //Get JSON
- var xmlhttp = new XMLHttpRequest();
- var url = "api/contacts";
- xmlhttp.onreadystatechange = function () {
- if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
- var parse = JSON.parse(xmlhttp.responseText);
- process(parse);
- }
- }
- xmlhttp.open("GET", url, true);
- xmlhttp.send();
-
- function process(a) {
- var table = document.getElementsByTagName("tbody")[0];
- var contacts = a;
- for (var i of contacts) {
- var contact = i;
- var row = table.insertRow();
- for (var j in contact) {
- if (j === "contact_id") continue;
- if (j === "website_url") {
- var url = row.insertCell();
- url.innerHTML = "<a href =" + contact[j] + ">" + contact[j] + "</a>";
- } else if (j === "email") {
- var email = row.insertCell();
- email.innerHTML = "<a href =mailto://" + contact[j] + ">" + contact[j] + "</a>";
- } else {
- var value = row.insertCell();
- value.innerHTML = contact[j];
- }
- }
- }
- }
-
- function add() {
-
- }
-
- </script>
- </head>
- <body>
- <nav class="navbar navbar-default">
- <div class="container-fluid">
- <ul class="nav navbar-nav">
- <li><a href="/"><b>Home</b></a></li>
- <li><a href="contacts"><b>Contacts</b></a></li>
- <li><a href="stock"><b>Stock Page</b></a></li>
- <li><a href="logout"><b>Logout</b></a></li>
- </ul>
- </div>
- </nav>
- <br><br>
-
- <div class="container">
- <button type="button" id="add">Add Contact</button>
- <table class="table" id="contactsTable">
- <thead>
- <tr>
- <th scope="col">Name</th>
- <th scope="col">Category</th>
- <th scope="col">Location</th>
- <th scope="col">Contact Information</th>
- <th scope="col">Email</th>
- <th scope="col">Website <br> (URL) </th>
- </tr>
- </thead>
- <tbody></tbody>
- </table>
- </div>
- <script type="text/javascript">
-
- </script>
- </body>
-</html> \ No newline at end of file