unexpected end of json input at

You are calling:

JSON.parse(scatterSeries)
But when you defined scatterSeries, you said:

var scatterSeries = []; 
When you try to parse it as JSON it is converted to a string (""), which is empty, so you reach the end of the string before having any of the possible content of a JSON text.

scatterSeries is not JSON. Do not try to parse it as JSON.

data is not JSON either (getJSON will parse it as JSON automatically).

ch is JSON … but shouldn't be. You should just create a plain object in the first place:

var ch = {
    "name": "graphe1",
    "items": data.results[1]
};

scatterSeries.push(ch);
In short, for what you are doing, you shouldn't have JSON.parse anywhere in your code. The only place it should be is in the jQuery library itself

3.5
4

                                    Uncaught SyntaxError: Unexpected end of JSON input at JSON.parse

3.5 (4 Votes)
0
Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
errorMessage Unexpected end of JSON input The following error occurred: parsererror SyntaxError: Unexpected end of JSON input AJAX error: parsererror : SyntaxError: Unexpected end of JSON input SyntaxError: Unexpected end of JSON input .catch(error => console.log(error)) unexpected end of json input c# unexpected end of json input "@dexexpress" Unexpected end of JSON input at parse (<anonymous>) Unexpected end of JSON input "DexExpress" Unexpected end of JSON input @DexExpress httparty Unexpected end of JSON input Unexpected end of JSON input at eval undefined:1 SyntaxError: Unexpected end of JSON input Unexpected end of JSON input at JSON.parse (<anonymous>) at XMLHttpRequest.onLoad json.parse error unexpected input at position Unexpected end of JSON input response.json unexpected end of json input in deutsch unexpected end of json input deutsch Unexpected end of JSON input at generator.next promise unexpected end of json input Unexpected end of JSON input from superagent unexpected end of json input while parsing near Unexpected end of JSON input while parsing near '' npm i err Unexpected end of JSON input SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>) Uncaught (in promise) SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>) at app.js:3398 json stringify error unexpected end of input Unexpected end of JSON input JSON stringify error javascript unexpected end of input json : Unexpected end of JSON input js response.json SyntaxError: Unexpected end of input Unexpected end of JSON input at getEmployees unexpected end of json input at json.parse collectd "unexpected end of JSON input" collectd unexpected end of JSON input collect unexpected end of JSON input SyntaxError: Unexpected end of JSON input at ?editor_console=true:167 Unexpected end of JSON input while parsin node Unexpected end of JSON input "sfdx" "unexpected end of json input" sfdx unexpected end of json input Unexpected end of JSON input at HTMLFormElement ajax SyntaxError: Unexpected end of JSON input js SyntaxError: Unexpected end of JSON input log4js Error was Unexpected end of JSON input unexpected end of json input reactjs how to handle SyntaxError: Unexpected end of JSON input visual studio code unexpected end of json input "Unexpected end of JSON input" not able to find line Unexpected end of JSON input at parse npm unexpected end of json input SyntaxError: Unexpected end of JSON input at parse SyntaxError: Unexpected end of JSON input at JSON.parse on Publish unexpected end of json input in npm run npm install unexpected end of json input chrome json SyntaxError: Unexpected end of JSON input unexpected end of json input, unexpected end of json input, working fine in local undefined 1 syntaxerror unexpected end of json input JSONError: Unexpected end of input at django delete unexpected end of json input SyntaxError: Unexpected end of JSON input). Please try again. unexpected end of json input package.json JSON decode error: unexpected end of JSON input '' SyntaxError: Unexpected end of JSON input Uncaught SyntaxError: Unexpected end of JSON input jq : Unexpected end of JSON input unexpected end of json input in react js Unexpected end of JSON input getItem unexpected end of JSON inputjs Error: FormatException: SyntaxError: Unexpected end of JSON input Uncaught SyntaxError: Unexpected end of JSON input ' json_encode unexpected end of input response.json() gives an error "unexpected end of input" unexpected end of json input error Unexpected end of JSON input vscode FormatException: Unexpected end of input (at character 1) jsonEncode response.json() SyntaxError: Unexpected end of input response .json() 5 SyntaxError: Unexpected end of input unexpected end of json input in javascript "tasks...ERROR >> SyntaxError:" "Unexpected end of JSON input" "unexpected end of JSON input" golang node js SyntaxError: Unexpected end of JSON input errorThrown: SyntaxError: Unexpected end of JSON input listjs Unexpected end of JSON input list.js Unexpected end of JSON input list.js Uncaught SyntaxError: Unexpected end of JSON input Failed: Unexpected end of JSON input catch unexpected end of json input error react unexpected end of json input error on submit jquery.min.js:2 jQuery.Deferred exception: Unexpected end of JSON input SyntaxError: Unexpected end of JSON input "Uncaught SyntaxError: Unexpected end of JSON input" yntaxError: Unexpected end of JSON input an unexpected end of json input in beautify an unexpected end of json input unexpected end of json imput unexpected end of json input json stringify Unexpected end of JSON input" Unexpected end of JSON input at JSON.parse (<anonymous>) Unexpected end of JSON input at JSON.parse (<anonymous>) at Object.success { "error": "Unexpected end of JSON input" } Unexpected end of JSON input nodejs unexpected end of json input while installing react unexpected end of json input react while installing syntaxerror unexpected end of json input null object Unexpected end of JSON input at JSON.parse aden Unexpected end of JSON input while chai testing SyntaxError: Unexpected end of JSON input\ Unexpected end of JSON input at JSON.parse (<anonymous>) at "HTMLButtonElement.<" anonymous> syntax error unexpected end of json input Error : SyntaxError: Unexpected end of JSON input with jquery Unexpected end of JSON input exception with escapes Unexpected end of JSON input exception but succeeds Uncaught SyntaxError: Unexpected end of JSON input at JSON.parse check for unexpected json end of input Unexpected end of JSON input react native Error! Error: Unexpected end of JSON input read empty json file unexpected end of json input unexpected end of json input node js Tracking exception SyntaxError: Unexpected end of JSON input unexpected end of JSON input go npm error unexpected end of json input SyntaxError: Unexpected end of JSON input cgi file unexpected end of json input cgi python reason: Unexpected end of JSON input "Unexpected end of JSON input" response.json() unexpected end of input unexpected end of json input js unexpected end of json input undefined parsererror" SyntaxError: Unexpected end of JSON input Uncaught SyntaxError: Unexpected end of JSON input "srmklive" Uncaught SyntaxError: Unexpected end of JSON input srmklive unexpected ending of json input unexpected end of json input javascript res json unexpected end of json input javascript uncaught sysntaxeror unexpected end of JSON input annoymou Unexpected end of JSON input json.parse syntaxerror unexpected end of json input json.parse uncaught syntaxerror unexpected end of json input unexpected end of json input dash app create checkout error Error: Unexpected end of JSON input React error syntaxerror unexpected end of json input angular stringify Uncaught SyntaxError: Unexpected end of JSON input JSON.stringify stringify Uncaught SyntaxError: Unexpected end of JSON input unexpected end of json input goland reason: Unexpected end of JSON input", Uncaught SyntaxError: Unexpected end of JSON input in chrome extension patch Unexpected end of JSON input FormatException: SyntaxError: Unexpected end of JSON input response.json() SyntaxError: Unexpected end of JSON input Something went wrong: SyntaxError: Unexpected end of JSON input server.inject hapi "Unexpected end of JSON input server.inject hapi ]"Unexpected end of JSON input checkedornot:1 Uncaught SyntaxError: Unexpected end of JSON input unexpected end of json input chrome error SyntaxError: Unexpected end of JSON input Unexpected end of JSON input". unexpected end of json output syntaxerror unexpected end of json input SyntaxError: Unexpected end of JSON input response.json Unexpected end of JSON input3 unexpected end of json unput ncaught SyntaxError: Unexpected end of JSON input unexpected end of json input token {"message":"unexpected end of JSON input","status":false} unexpected end of json input storybook rxjs SyntaxError: Unexpected end of JSON input angular unexpected end of json input installation error angular unexpected end of json input SyntaxError: Unexpected end of JSON input js json.parse unexpected end of json input how to fix unexpected end of json input typorm Unexpected end of JSON input Unexpected end of JSON input dev to unexpected end of json input at json.parse ( anonymous ) verbose stack syntaxerror unexpected end of json input javascript unexpected end of json input "SyntaxError: Unexpected end of JSON input", js unexpected end of json input unexpected end of json input while npm install What does unexpected end of JSON input mean? Error in event handler: SyntaxError: Unexpected end of JSON input Unhandled Rejection (Error): Unexpected end of JSON input SyntaxError: Unexpected end of JSON input or 500 get request unexpected end of json input error check Unexpected end of JSON input SyntaxError: Unexpected end of JSON input. unexpected end of json Uncaught SyntaxError: Unexpected end of JSON input SyntaxError: Unexpected end of input reponse .json() invalid json response body unexpected end of json input VM3000:1 Uncaught (in promise) SyntaxError: Unexpected end of JSON input Unexpected end of JSON input SyntaxError: UNEXPECTED END OF json input react message: "Unexpected end of JSON input" Unexpected end of JSON input at JSON.parse (<anonymous>) react unexpected end of json input Unhandled Rejection (SyntaxError): Unexpected end of JSON input error: unexpected end of JSON input Error: SyntaxError: Unexpected end of JSON input for JSON.stringify Error: SyntaxError: Unexpected end of JSON input intercom Unexpected end of JSON input Unexpected end of JSON input messagequeue.js SyntaxError: Unexpected end of JSON input unexpected end of json input npm install unexpected end of json input unexpected end of json input at
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source