Syntaxerror: unexpected end of JSON input [How to Solve]

Onload executes only once
SetData stores data in the page cache
if the data is undefined, you may need that = this. After the curly braces, the of these changes
e in the event function is an event, which refers to the event of this operation
options are objects.

If it is written like this, an error will be reported: syntax error: unexpected end of JSON input

At this time, do not use the arrow function!

So there is no error!

Read More: