ASE LAB 3
TEAM 4
Class ID 3 : Chepsoy, Herbert Kiplagat
Class ID 20: Oguntimehin, Josh Joshua
Part-1:Login and Register pages:
Create login and register pages and implement local storage functionality on the register page.
A user needs to login to view the home page with part-2.
The user creates and account
The account information is used to login
Local storage is implemented thus capture values entered
Error shown on incorrect entry and Login to Part two if facilitated on accurate credentials


Part-2:1.Create your own necessary keys (Nutritionix and IBM Watson text to speech API’s) to complete assignment
2.Make an application using *url-1 to display following info:Calories and serving weight in grams
3.Use Watson Text to speech API using url-2 to speak out the searched keyword
We correspondinge application it pulls Calories and weight fields
It promts search of the item and it display it's corrensponding Details
Code
Login
<script type="text/javascript" src="jquery-1.11.3.min.js"></script>
<script type="text/javascript" language="javascript" src="login.js"></script>
<script>
// Name and Password from the register-form
var name12 = document.getElementById('name12');
var pw = document.getElementById('pw');
// storing input from register-form
function store() {
localStorage.setItem('name12', name12.value);
localStorage.setItem('pw', pw.value);
}
// check if stored data from register-form is equal to entered data in the login-form
function check() {
// stored data from the register-form
var storedName = localStorage.getItem('name12');
var storedPw = localStorage.getItem('pw');
// entered data from the login-form
var userName = document.getElementById('userName');
var userPw = document.getElementById('userPw');
// check if stored data from register-form is equal to data from login form
if(userName.value == storedName && userPw.value == storedPw) {
window.open("nutritionixapi.html");
//alert('You are loged in.');
}else {
alert('ERROR.');
}
}
$('.message a').click(function(){
$('form').animate({height: "toggle", opacity:"toggle"}, "slow");
});
</script>