-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·72 lines (41 loc) · 1.72 KB
/
index.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8">
<title>Teach Me</title>
<script>
// JavaScript Document
var bd;
window.addEventListener("load", iniciar(), false);
function iniciar() {
solicitud = indexedDB.open("olaya");
solicitud.onsuccess = function(e) {
bd = e.target.result;
}
solicitud.onupgradeneeded = function(e) {
bd = e.target.result;
bd.createObjectStore("nota", {keyPath: "id", autoIncrement: true});
bd.createObjectStore("calendario", {keyPath: "id", autoIncrement: true});
bd.createObjectStore("anotaciones", {keyPath: "id", autoIncrement: true});
bd.createObjectStore("usuario", {keyPath: "id", autoIncrement: true});
bd.createObjectStore("horario", {keyPath: "id", autoIncrement: true});
}
solicitud.addEventListener("success", mostrar, false);
}
function mostrar() {
var transaccion = bd.transaction(["usuario"], "readonly");
var almacen = transaccion.objectStore("usuario");
var cursor = almacen.openCursor();
cursor.addEventListener("success", mostrar2, false);
}
function mostrar2(e) {
cursor_usuario = e.target.result;
if(cursor_usuario){
window.location ="existe.html";
}else{
window.location ="noexiste.html";
}
}
</script>
</head>
</html>