HTML5 APPLICATIONS DEVELOPMENT MANUAL

(lu) #1

welcome.innerHTML = message;
level_object.value = level;
}
function save_level() {
setCookie("level", level_object.value, 10);
}
function setCookie(c_name, value, exdays) {
var exdate = new Date();
exdate.setDate(exdate.getDate() + exdays);
var c_value = escape(value) + ((exdays == null)? "" : "; expires=" + exdate.toUTCString());
document.cookie = c_name + "=" + c_value;
}





Use of cookies


Welcome.



You can update your level at any time. It is currently set at min="1" max="100" oninput="save_level();" />.



Local Storage


Cookies are limited in the information they store, and therefore in the


effects programming with them can achieve. Plus, cookies pose a threat to


data privacy. HTML5 provides local storage to make personalization easier


to program and more capable.


<!doctype html>




Use of local storage
Free download pdf