Hands-On Artificial Intelligence on Amazon Web Services by Subhashini Tripuraneni
Author:Subhashini Tripuraneni
Language: eng
Format: epub, mobi
Tags: COM004000 - COMPUTERS / Intelligence (AI) and Semantics, COM048000 - COMPUTERS / Systems Architecture / Distributed Systems and Computing, COM037000 - COMPUTERS / Machine Theory
Publisher: Packt Publishing
Published: 2019-10-04T12:11:27+00:00
function saveContact() {
let contactInfo = {};
let fields = ["name", "title", "email", "phone", "organization", "address", "city", "state", "zip"];
fields.map(function(field) {
let element = document.getElementById(field);
if (element && element.value) {
contactInfo[field] = element.value;
}
return field;
});
let imageElem = document.getElementById("image");
contactInfo["image"] = imageElem.src;
// make server call to save contact
return fetch(serverUrl + "/contacts", {
method: "POST",
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify(contactInfo)
}).then(response => {
if (response.ok) {
clearContact();
return response.json();
} else {
throw new HttpError(response);
}
})
}
In the preceding code snippet, the following things occur:
The saveContact() function gets a value from every input field and then creates the contactInfo data structure. This function then sends the data in contactInfo to the server for persistence.
If the response from the server is ok, it means the contact has been saved.
Then, this function calls the clearContact() function to clear the values of the input fields and the image display.
Download
Hands-On Artificial Intelligence on Amazon Web Services by Subhashini Tripuraneni.mobi
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Computer Vision & Pattern Recognition | Expert Systems |
Intelligence & Semantics | Machine Theory |
Natural Language Processing | Neural Networks |
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8296)
Test-Driven Development with Java by Alan Mellor(6705)
Data Augmentation with Python by Duc Haba(6612)
Principles of Data Fabric by Sonia Mezzetta(6367)
Learn Blender Simulations the Right Way by Stephen Pearson(6261)
Microservices with Spring Boot 3 and Spring Cloud by Magnus Larsson(6127)
Hadoop in Practice by Alex Holmes(5958)
Jquery UI in Action : Master the concepts Of Jquery UI: A Step By Step Approach by ANMOL GOYAL(5806)
RPA Solution Architect's Handbook by Sachin Sahgal(5526)
Big Data Analysis with Python by Ivan Marin(5353)
The Infinite Retina by Robert Scoble Irena Cronin(5223)
Life 3.0: Being Human in the Age of Artificial Intelligence by Tegmark Max(5144)
Pretrain Vision and Large Language Models in Python by Emily Webber(4312)
Infrastructure as Code for Beginners by Russ McKendrick(4076)
Functional Programming in JavaScript by Mantyla Dan(4038)
The Age of Surveillance Capitalism by Shoshana Zuboff(3946)
WordPress Plugin Development Cookbook by Yannick Lefebvre(3788)
Embracing Microservices Design by Ovais Mehboob Ahmed Khan Nabil Siddiqui and Timothy Oleson(3590)
Applied Machine Learning for Healthcare and Life Sciences Using AWS by Ujjwal Ratan(3567)
