Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

VM724:1 Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0

// if your json data doesn't show then just replace this code. 
handleGetJson = () =>{
  fetch(`./data.json`, {
      headers : { 
        'Content-Type': 'application/json',
        'Accept': 'application/json'
       }
    })
     .then(res=> res.json())
     .then(data=> console.log(data))
}
 
PREVIOUS NEXT
Tagged: #Uncaught #Unexpected #token #JSON #position
ADD COMMENT
Topic
Name
6+8 =