Training Guide: Programming in HTML5 with JavaScript and CSS3 Ebook

(Nora) #1

572 CHAPTER 15 Local data with web storage


clear: left;
display: block;
float:left;
}

#editContact input {
width: 150px;
padding: 2px;
}

button {
width: 200px;
margin-top: 10px;
}

#contacts {
width: 400px;
border: 1px solid #E1E1E1;
margin: 0px;
padding: 0px;
}

#contacts thead {
background-color: #e1e1e1;
color: #7C756D;
font-weight: bold;
text-align: left;
}

#contacts tbody tr:nth-child(even) {
background-color: #eee;
}

#contacts th {
border-color: #7C756D;
border-style: none none solid;
border-width: 0 0 1px;
}

#contacts th, #contacts td {
margin: 0px;
padding: 5px 10px;
}


  1. Open and review the ContactsLibrary.js file.
    This file has a reference to the jQuery library. Following that is a document ready func-
    tion that calls the initialize function in the contactsNamespace. Under the document
    ready function is the contactsNamespace, which contains a currentRecord variable and
    the initialize property, which is assigned an empty function. The ContactsLibrary.js file
    is as follows.
    ///


$(document).ready(function () {
Free download pdf