save a note to localstorage as an Object
This commit is contained in:
+35
-1
@@ -2,4 +2,38 @@ $(document).ready(function(){
|
||||
$("#addNoteDiv").on('click', function() {
|
||||
$("#noteFormDiv").toggle()
|
||||
})
|
||||
})
|
||||
$("#saveNoteButton").click(getNoteObject);
|
||||
})
|
||||
|
||||
const noteFolder = "C:\\Users\\wuest\\Desktop\\Studium\\Master\\MDT5\\Hofmann\\Praktikum\\WebApp\\notes\\";
|
||||
|
||||
function saveNoteObject(){
|
||||
let noteTitle = document.getElementById('inputTitle').value;
|
||||
let noteText = document.getElementById('noteText').value;
|
||||
|
||||
let noteObj = {
|
||||
title: noteTitle,
|
||||
text: noteText
|
||||
};
|
||||
|
||||
let noteObj_serialized = JSON.stringify(noteObj);
|
||||
localStorage.setItem("noteObj", noteObj_serialized);
|
||||
}
|
||||
|
||||
function getNoteObject(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user