Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6187929
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:08:33+00:00 2026-05-24T02:08:33+00:00

I am encountering a Uncaught SyntaxError: Unexpected end of input at the following code.

  • 0

I am encountering a Uncaught SyntaxError: Unexpected end of input at the following code.

var dataURL = "LineChartController?tp=" + tpAtt + "&dept=" + dept + "&date=" + dateMY;
               alert(dataURL);
               var JSONdata = jQuery.ajax({
                              type: "GET",
                              url: dataURL,
                              async: false
                              }).responseText;

var psSeriesData2 = JSON.parse(JSONdata);

I am tried looking around and found no solution. These are the steps that I have taken.

Ensuring the JSONdata is correct – checked via http://www.jsonlint.com/ and
Ensuring that I have closed all brackets

The JSONdata is in the following format:

[{"Dates":["1-10","2-10","3-10","4-10","5-10","6-10","7-10","8-10"],"psScores":[78.78787878787878,79.7979797979798,78.78787878787878,78.78787878787878,78.78787878787878,79.7979797979798,79.7979797979798,76.92307692307693]}]

Another thing I did is that I am using prototype.js and other javascript libraries that cause an error,

Uncaught TypeError: Object function $(element) {
   if (arguments.length > 1) {
      for (var i = 0, elements = [], length = arguments.length; i < length; i++)
      elements.push($(arguments[i]));
      return elements;
   }
   if (Object.isString(element))
      element = document.getElementById(element);
      return Element.extend(element);
   } has no method 'ajax'

I searched through forum and found that the solution is to change the $.ajax to jQuery.ajax, however, after that, the Uncaught SyntaxError: Unexpected end of input error appeared.

Appreciate any help on this issue. Any ideas what the problem is?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T02:08:33+00:00Added an answer on May 24, 2026 at 2:08 am

    Is your server specifying a response type of application/json? If so, jQuery will automatically parse the result before it even gets back. Meaning, you’re trying to parse what’s already been parsed.

    Try specifying the dataType in your call, and jQuery will pre-parse the result for you.

    You should also try to do it asynchronously if possible.

    var dataURL = "LineChartController?tp=" + tpAtt + "&dept=" + dept + "&date=" + dateMY;
    var JSONdata = jQuery.ajax({
         type: "GET",
         dataType: "json",
         url: dataURL
    }).done(function(jsonData){
         // do something with the data, it should already be parsed
         alert(jsonData.length); // your data sample is an array, see if it gets a length back
    }).fail(function(xhr){
         // uh oh, we failed.. you should always handle failures too.
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm encountering an interesting issue with the following code. productObject is a custom object
I am encountering an unexpected behavior: The following statement works fine: Context.RewritePath( ~/Default.aspx );
I am encountering an exception cause by the CFINVOKEARGUMENT line of the following snippet:
I am encountering the following bug. I have a class Foo . Instances of
I'm encountering the following error when attempting to (svn) import from within Xcode). Import
I am encountering a problem which is how do I convert input strings like
Since yesterday I started encountering errors related to date formats in SQL Server 2008.
I'm encountering this Exception in my project using Protobuf.net: InvalidOperationException Unexpected sub-type: foo I
I'm encountering the following error at unpredictable times in a linux-based (arm) communications application:
I am randomly encountering the following error: Message: Invalid viewstate. Client IP: xx.xxx.xxx.xx Port:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.