Facing an Uncaught SyntaxError: Unexpected token o in JSON at position 1

Rishabh Gupta

I am building a ToDo List but facing an error

VM619:1 Uncaught SyntaxError: Unexpected token o in JSON at position 1
    at JSON.parse (<anonymous>)
    at showNotes (javapractice.html:121)
    at javapractice.html:97
showNotes @ javapractice.html:121
(anonymous) @ javapractice.html:97

This is how my code looks Javascript Code

In continuation to above, I want the delete button to work and hence wrote the below code.

 else {
            notesElm.innerHTML = `Nothing to show fucker`;
        }
    }
    // function to delete note
    function deleteNote(index) {
        console.log("Deleteme", index);

        let notes = localStorage.getItem("notes");
        if (notes == null) {
            notesObj = [];
        } else {
            notesObj = JSON.parse(notes);
        }

        notesObj.splice(index, 1);
        localStorage.setItem("notes", JSON.stringify(notesObj));
        showNotes();

But the button is not working.

Cedric Cholley

first line of showNotes function (line 117 on your screen shot), let Notes = … "Notes" should have a lower "n"

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

SyntaxError: Unexpected token o in JSON at position 1

Uncaught SyntaxError: Unexpected token u in JSON at position 0

React Js: Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0

Uncaught SyntaxError: Unexpected token o

SyntaxError: Unexpected token \ in JSON at position

Error when unit testing: "Uncaught (in promise) SyntaxError: Unexpected token o in JSON at position 1"

UnhandledPromiseRejectionWarning: SyntaxError: Unexpected token o in JSON at position 1

SyntaxError: Unexpected token o in JSON at position 1 EXPRESS

Uncaught SyntaxError: Unexpected token o in JSON at position 1 error

SyntaxError: Unexpected token o in JSON at position 1 over ajax request

SyntaxError: Unexpected token } in JSON at position

Jinja Flask issue: Uncaught SyntaxError: Unexpected token { in JSON at position 1 at JSON.parse

how to fix "Uncaught SyntaxError: Unexpected token _ in JSON at position . . . "

how to fix Uncaught SyntaxError: Unexpected token o in JSON at position 1

Uncaught SyntaxError: Unexpected token , in JSON at position 10

How to fix "SyntaxError: Unexpected token o in JSON at position 1"

Uncaught SyntaxError: Unexpected token c in JSON at position 13

'Uncaught SyntaxError: Unexpected token x in JSON at position 1' when trying to parse HTML embeded string JSON

Selectize Uncaught SyntaxError: Unexpected token # in JSON at position 0

Uncaught SyntaxError: Unexpected token p in JSON at position 36

SyntaxError - SyntaxError: Unexpected token < in JSON at position 1 - Ionic

SyntaxError: Unexpected token < in JSON at position 1 ionic

Uncaught SyntaxError: Unexpected token < in JSON at position 0 from Codeigniter response

SyntaxError: Unexpected token { in JSON at position 1

Uncaught Promise Rejection SyntaxError: Unexpected token u in JSON at position 0

Uncaught SyntaxError: Unexpected token a in JSON at position 2

VM299:1 Uncaught SyntaxError: Unexpected token u in JSON at position 0 at JSON.parse (<anonymous>)

SyntaxError: Unexpected token o in JSON at position 1 in angular

Uncaught (in promise) SyntaxError: Unexpected token r in JSON at position 0