Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
82 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
var base = "http://phonebk.develop.digitalmediauconn.org/phonebook.php"; | ||
|
||
function getAllPeople() { | ||
function ajaxCall(uri, callback) { | ||
var ajaxcall = new XMLHttpRequest(); | ||
|
||
ajaxcall.onreadystatechange = function () { | ||
|
||
if (ajaxcall.readyState == 4 && ajaxcall.status == 200) { | ||
|
||
document.querySelector(targetSelector).innerHTML = ajaxcall.responseText; | ||
|
||
|
||
} | ||
|
||
} | ||
ajaxcall.onreadystatechange = callback; | ||
|
||
ajaxcall.open("GET", base + "?do=getAllPeople", true); | ||
ajaxcall.send(); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<!doctype html> | ||
<html class="no-js" lang=""> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="x-ua-compatible" content="ie=edge"> | ||
<title></title> | ||
<meta name="description" content=""> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
|
||
<link rel="apple-touch-icon" href="apple-touch-icon.png"> | ||
<!-- Place favicon.ico in the root directory --> | ||
|
||
<link rel="stylesheet" href="css/normalize.css"> | ||
<link rel="stylesheet" href="css/main.css"> | ||
<script src="js/vendor/modernizr-2.8.3.min.js"></script> | ||
</head> | ||
<body> | ||
<!--[if lt IE 8]> | ||
<p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p> | ||
<![endif]--> | ||
|
||
<!-- Add your site or application content here --> | ||
<h1 id="page_title"> | ||
|
||
</h1> | ||
|
||
<h2 id="page_tagline"> | ||
|
||
</h2> | ||
|
||
<p id="page_description"> | ||
</p> | ||
<script src="https://code.jquery.com/jquery-1.12.0.min.js"></script> | ||
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.12.0.min.js"><\/script>')</script> | ||
<script src="js/plugins.js"></script> | ||
<script> | ||
function getMessage(targetURL) { | ||
var ajaxcall = new XMLHttpRequest(); | ||
|
||
ajaxcall.onreadystatechange = function () { | ||
|
||
if (ajaxcall.readyState == 4 && ajaxcall.status == 200) { | ||
|
||
var text = JSON.parse(ajaxcall.responseText); | ||
console.log(text); | ||
document.querySelector("#page_title").innerHTML = text.title; | ||
document.querySelector("#page_tagline").innerHTML = text.tagline; | ||
document.querySelector("#page_description").innerHTML = text.description; | ||
|
||
|
||
} | ||
|
||
} | ||
ajaxcall.open("GET", targetURL, true); | ||
ajaxcall.send(); | ||
} | ||
getMessage("text.json"); | ||
|
||
|
||
|
||
</script> | ||
|
||
<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. --> | ||
<script> | ||
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]= | ||
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date; | ||
e=o.createElement(i);r=o.getElementsByTagName(i)[0]; | ||
e.src='https://www.google-analytics.com/analytics.js'; | ||
r.parentNode.insertBefore(e,r)}(window,document,'script','ga')); | ||
ga('create','UA-XXXXX-X','auto');ga('send','pageview'); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"title": "Home Page", | ||
"tagline": "This is the tagline", | ||
"description": "this is the description!" | ||
} |