loop parse json
HTML
<table>
<tr>
<th>Username</th>
<th>First Name</th>
<th>Last Name</th>
</tr>
</table>
CSS
@import url(https://fonts.googleapis.com/css?family=Press+Start+2P|Roboto+Condensed);
@import url(https://fonts.googleapis.com/css?family=Press+Start+2P|Roboto+Condensed);
@import url(https://fonts.googleapis.com/css?family=Press+Start+2P|Roboto+Condensed);
body {
font-family: Press Start\ 2P, cursive;
margin: 0;
padding: 0;
font-family: sans-serif;
background-color: #000
}
.App {
text-align: center
}
.App-logo {
-webkit-animation: App-logo-spin infinite 20s linear;
animation: App-logo-spin infinite 20s linear;
height: 80px
}
.App-header {
background-color: #222;
height: 150px;
padding: 20px;
color: #fff
}
.App-title {
font-size: 1.5em
}
.App-intro {
font-size: large
}
@-webkit-keyframes App-logo-spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg)
}
to {
-webkit-transform: rotate(1turn);
transform: rotate(1turn)
}
}
@keyframes App-logo-spin {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg)
}
to {
-webkit-transform: rotate(1turn);
transform: rotate(1turn)
}
}
.gameContainer {
display: -ms-flexbox;
display: flex
}
.error-marker {
position: absolute;
background-color: #ff0
}
body {
font-family: Lato, sans-serif;
height: 100%
}
a {
text-decoration: none
}
label {
display: block
}
nav a {
display: inline-block;
margin: 1em
}
@font-face {
font-family: Lato, sans-serif;
src: url("https://fonts.googleapis.com/css?family=Lato")
}
.styleSection {
height: 100%;
background-position: 50%;
background-repeat: no-repeat;
background-image: url("https://res.cloudinary.com/artwork-archive/image/upload/t_jpg_large/v1/user_4446/JillMcLean_BeyondAllDoubt_OilCanvas_43x36_2014_yxcbjr")
}
.carousel-caption {
position: absolute;
z-index: 1;
display: table;
width: 100%;
height: 100%
}
.absolute-div {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0
}
.carousel-caption h3 {
display: table-cell;
...
JavaScript
$(document).ready(function() {
var json = [{
"userId": "canMan5",
"jobTitleName": "Developer",
"firstName": "Eric",
"lastName": "Franz",
"preferredFullName": "Mr Franz",
"employeeCode": "E1",
"region": "CA",
"phoneNumber": "408-1234567",
"emailAddress": "[email protected]"
},
{
"userId": "nirani",
"jobTitleName": "Designer",
"firstName": "Neil",
"lastName": "Irani",
"preferredFullName": "Neil Irani",
"employeeCode": "E2",
"region": "CA",
"phoneNumber": "408-1111111",
"emailAddress": "[email protected]"
},
{
"userId": "tHanks",
"jobTitleName": "Program Directory",
"firstName": "Tom",
"lastName": "Hanks",
"preferredFullName": "Tom Hanks",
"employeeCode": "E3",
"region": "CA",
"phoneNumber": "408-2222222",
"emailAddress": "[email protected]"
},
{
"userId": "nCage",
"jobTitleName": "Actor",
"firstName": "Nic",
"lastName": "Cage",
"preferredFullName": "Nic Cage",
"employeeCode": "E19",
"region": "CA",
"phoneNumber": "408-1234567",
"emailAddress": "[email protected]"
}
];
var tr;
for (var i = 0; i < json.length; i++) {
tr = $('<tr/>');
tr.append("<td>" + json[i].userId + "</td>");
tr.append("<td>" + json[i].firstName + "</td>");
tr.append("<td>" + json[i].lastName + "</td>");
$('table').append(tr);
}
});