-
Notifications
You must be signed in to change notification settings - Fork 0
/
basePrueba.html
39 lines (30 loc) · 1.3 KB
/
basePrueba.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>IndexedDB: Almacenamiento local con HTML5</title>
<script type="text/javascript">
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
function startDB() {
dataBase = indexedDB.open("object", 1);
dataBase.onupgradeneeded = function (e) {
active = dataBase.result;
object = active.createObjectStore("people", { keyPath : 'id', autoIncrement : true });
object.createIndex('by_name', 'name', { unique : false });
object.createIndex('by_dni', 'dni', { unique : true });
};
dataBase.onsuccess = function (e) {
alert('Base de datos cargada correctamente');
};
dataBase.onerror = function (e) {
alert('Error cargando la base de datos');
};
}
</script>
</head>
<body onload="startDB();">
<!--
@TODO Código visible por el usuario.
-->
</body>
</html>