Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

194
Views
SyntaxError: Unexpected token < in JSON at position 8

Dears, I got error when i call the ajax function.

SyntaxError: Unexpected token < in JSON at position 8
    at JSON.parse (<anonymous>)
    at parseJSON (jquery?v=M6dmVkrHVhoZ1gfOtvVDZbgBcQTsbWxoLsRizcGkbPk1:1)
    at vo (jquery?v=M6dmVkrHVhoZ1gfOtvVDZbgBcQTsbWxoLsRizcGkbPk1:1)
    at k (jquery?v=M6dmVkrHVhoZ1gfOtvVDZbgBcQTsbWxoLsRizcGkbPk1:1)
    at XMLHttpRequest.u (jquery?v=M6dmVkrHVhoZ1gfOtvVDZbgBcQTsbWxoLsRizcGkbPk1:1)

This is my ajax call code:

   function MyFunction() {

    $.get("/Base/TestMethod", { message: 'nice' }, function (data) {

        console.log(data);

    }, 'json').fail(function (jqXhr, textStatus, errorThrown) {
        alert(textStatus + ": " + errorThrown + ": " + jqXhr.responseText);
        console.log(errorThrown);
    });
}
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

In my case, the returned JSON was too big. Try set MaxJsonLength to max int value.

var jsonResult = Json(obj, JsonRequestBehavior.AllowGet);
jsonResult.MaxJsonLength = int.MaxValue;
return jsonResult;
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!