Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
window.msIndexedDB;
window.IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction ||
window.msIDBTransaction;
window.IDBKeyRange = window.IDBKeyRange ||
window.webkitIDBKeyRange || window.msIDBKeyRange
if (!window.indexedDB) {
window.alert("Your browser doesn't support a stable version of IndexedDB.")
}
console.log("Hello man! This is for testing, please ignore it.");
var request = window.indexedDB.open("ToDo-Task", 1),
db,
tx,
store,
index;
request.onupgradeneeded = function(e) {
let db = request.result;
store = db.createObjectStore("ToDo",{autoIncrement: true});
};
request.onerror = function(e) {
console.log("There is an error"+e.target.errorCode);
};
request.onsuccess = function(e) {
console.log("OnSuccess!");
db = request.result;
tx = db.transaction("ToDo", "readwrite");
store = tx.objectStore("ToDo");
console.log("ToDo!");
var table_id = document.getElementById ('todo');
table_id.innerHTML =
'<tr><td>notesName</td><td>Description</td><td>DueDate</td></tr>';
store.openCursor (null, 'prev').onadd = function (e) {
var cursor = e.target.result;
console.log(cursor);
if (cursor) {
table_id.innerHTML +='<tr><td>' + cursor.value.taskname + '</td><td>' + cursor.value.taskdescription + '</td><td>' + cursor.value.duedate + '</td></tr>';
cursor.continue ();
} else {
console.log ('No Entries!');
}
};
db.onerror = function(e) {
console.log("ERROR" + e.target.errorCode);
}
db.onsuccess = function() {
console.log("SUCCESS");
}
/*
store.add( { taskname: "HARD", taskdescription: "VERY HARD", duedate: "23-10-18"});
console.log("Stored.");
request.onsuccess = function(e) {
console.log("ENTERED");
};
*/
tx.oncomplete = function() {
db.close();
};
}
window.add = function (tn, td, dd) {
console.log("Add");
var request = window.indexedDB.open("ToDo-Task", 1),
db,
tx,
store,
index;
request.onerror = function(e) {
console.log("There is an error"+e.target.errorCode);
};
request.onsuccess = function(e) {
db = request.result;
tx = db.transaction("ToDo", "readwrite");
store = tx.objectStore("ToDo");
console.log("ToDo!");
db.onerror = function(e) {
console.log("ERROR" + e.target.errorCode);
}
db.onsuccess = function() {
console.log("SUCCESS");
}
store.add( { taskname: tn, taskdescription: td, duedate: dd});
window.localStorage.clear();
var table_id = document.getElementById ('todo');
table_id.innerHTML =
'<tr><td>notesName</td><td>Description</td><td>DueDate</td></tr>';
console.log("table");
store.openCursor (null, 'prev').onsuccess = function (e) {
var cursor = e.target.result;
console.log(cursor);
if (cursor) {
table_id.innerHTML +='<tr><td>' + cursor.value.taskname + '</td><td>' + cursor.value.taskdescription + '</td><td>' + cursor.value.duedate + '</td></tr>';
cursor.continue ();
} else {
console.log ('No Entries!');
}
};
console.log("DB Close.");
tx.oncomplete = function() {
db.close();
};
}
}
function addTask() {
var tn = document.getElementById("task-name").value;
var td = document.getElementById("task-description").value;
var dd = document.getElementById("due-date").value;
console.log("Hello!");
console.log(tn + " " + td + " " + dd);
//document.getElementById("num1").innerHTML = tn;
add(tn, td, dd);
document.getElementById('form').reset();
}
window.putValue = function() {
var local = window.localStorage;
local.tname = document.getElementById("task-name").value;
local.tdescription = document.getElementById("task-description").value;
local.ddate = document.getElementById("due-date").value;
}
window.getValue = function() {
var local = window.localStorage;
if(local.tname != undefined) {
document.getElementById("task-name").value = local.tname;
}
if(local.tdescription != undefined) {
document.getElementById("task-description").value = local.tdescription;
}
if(local.ddate != undefined) {
document.getElementById("due-date").value = local.ddate;
}
}
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team