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 6108773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:19:54+00:00 2026-05-23T14:19:54+00:00

I am getting SyntaxError: Unexpected token ILLEGAL from Google Chrome and Unterminated string constant

  • 0

I am getting “SyntaxError: Unexpected token ILLEGAL” from Google Chrome and “Unterminated string constant” from IE9 (both are reported as ParserErrors) when I receive the result of an ajax request through jQuery. This function works fine in Firefox.

The result in Chrome from Webkit dev tools is:

"{"LoginResult":{"ErrorMessage":null,"Succeeded":true,"SuccessMessage":null,"AuthToken":"504F4DB7C9C5599AFDE10BBE6B147338042378C5AA2B6F6FE832C29914AD8011161917D496FA037807CCF70D9324B57C56D13C666105DDF7A9A4D3E4D3B20186008D423A31CC4D752DB281A723C726BFADBAA1EDA0F1B878EA9A23DD14A21168CFC5F01122479AA4C95917C477655B005E5094E200839E64F6EAF7D56845D30C08728E8E9BE1F4B503B919A88CF98321F77109D0AFC8DFD347A01BFCEBE728D31F1F1F6AFE2A4DF5675E6D03C29638CEF027DEC52D5"

The result in IE9 from IE dev tools is:

"{\"LoginResult\":{\"ErrorMessage\":null,\"Succeeded\":true,\"SuccessMessage\":null,\"AuthToken\":\"AB0FB8336925444BC679E757A8237BDBE9B379C2BE0CD81502CDAE53F78BCE6896D33A54AD8C436E6C6E61C99C631A7363EFAB260A82256508D4A5D0C5891A3F6C124577F743E802CDF3E6E3A182E4614E2670DA010731CCEE115C9DED6C73138F7D97CB8E1E77DE572026D230D1DEE4C481A69C6E22C934CC0D855E3A2E7221CF666C6682E329B82B872751F5F297126BBA545D3027271681C9AA63073E4A018A04AD8A7EEC6E065F0074AF7FE343F190A65E2FCA"

The result in Firefox from Firebug is:

"{\"LoginResult\":{\"ErrorMessage\":null,\"Succeeded\":true,\"SuccessMessage\":null,\"AuthToken\":\"B278D66AD2CCF3CC40DE4AB16D75ED691E1B63F7E93D89E351CF3AA518D4D85D5212753EB26D3CDB22BF70F6369E8CB42B9BDE8079B8B60C42BD3BE3C9FF3670892C8049B64ABB47ED4117FAED8C5F36B35C99241398232B9F5EF4AC8702F2A3984B3FE0E3E5CF5A642C7A2140EFE249EC15755D5971C49EE5F863A0C8EBE10E2973532843656A4C6A89B3E4333F55B7180C2614C92BB28E18611FAE6894DF835AF965E82F762B67B7030559B4CBE6C9DCAD38B1667D347EE44CDED5207ABF5967D947FEE1DAC788F656ACBE395444F4418979A906DA2788C02666BCB1002EE3\"}}"

As you can see, for this particular request, the responseText of the jquery ajax call seems to be truncated at that point in the authToken for Chrome and IE, although I don’t know why as they are all just hex chars.

The function works on the server side, it is just the result once it gets to the client side that is the issue.

I use a common ajax request function, that passes parameters in order to create the request.

These are the important parameters.

  • async: true
  • method: “GET”
  • data: {}
  • serviceUrl: “ServiceName.svc/Login?username=user.name&password=dev&rememberMe=false”

The following is my ajax call code:

$.ajax({
    async: async,
    cache: false, // don't cache results
    type: method,
    url: Lib.Services.baseUrl + serviceUrl,
    contentType: "application/json; charset=utf-8",
    data: data,
    dataType: "json",
    processData: false, // data processing is done by ourselves beforehand
    success: function (data, statusText, request) {

        if (data !== null && data !== {}) {
            if (data.d && data.d.__type) {
                data = data.d;
            }
            else {

                var keys = [];
                for (key in data) {
                    if (data.hasOwnProperty(key)) {
                        keys.push(key);
                    }
                }
                if (keys.length !== 1) {

                }
                else {
                    // Wrapped message: return first property
                    $.each(data, function (name, value) {
                        data = value;
                        return false;
                    });
                }

            }
        }

        if (data === null) {
            window.location = "/login";
        }
        else {
            successHandler(data, statusText, request);
        }

    },
    error: function (request, statusText, error) {
        var res = request.responseText;

        if (request.status !== 200) {
            if (!request.isResolved()) {
                if (request.status === 0 && Lib.debug) {
                    Lib.ShowError("Debug: Check solution is running");
                }
                else {
                    Lib.ShowError(request.status + " " + error);
                }
            }
            else {
                Lib.ShowError("Request could not be resolved.");
            }
        }
        else {
            Lib.ShowError("Unknown error status.");
        }

        if (typeof (errorHandler) === "function") {
            errorHandler();
        }

    }
});

When I run this call, the “Unknown error status” message is shown.

I have searched and viewed numerous posts about this message, but the issue typically seems to be with the request, rather than the result.

Does anyone have any clues as to what might be causing this? It seems to be happening for all my web service requests (for example, in Chrome, the responseText of another of my services is just "{"GetStatusDat")

The method responses are typical Wrapped WCF responses, with request and response type of Json.

Browsers: Firefox 5.0 | Chrome 12.0.742.112 | IE9 9.0.8112.16421: Update versions 9.0.1

  • 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-23T14:19:54+00:00Added an answer on May 23, 2026 at 2:19 pm

    I discovered what the issue was.

    I remembered that I had enabled the RadCompressionModule from Telerik in web.config:

    <httpModules>
        <add name="RadCompression" type="Telerik.Web.UI.RadCompression" />
    </httpModules> 
    

    This seems to interfere with (i.e. compress) the JSON returns of any web service call in a way that only Firefox can deal with. Strangely, Internet Explorer 6 was fine with it, but I have a feeling that the compression module is disabled for IE6.

    If anyone has any ideas for getting the two working together, they would be greatly appreciated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting this error Uncaught SyntaxError: Unexpected token < from chrome but everything
I'm getting an Unexpected TOKEN illegal error on the following javascript: $(function() { $(‘.delete_post’).bind(‘ajax:success’,
Why am I getting this error: Uncaught SyntaxError: Unexpected token < c.b.extend.globalEval jquery-1.4.4.min.js:32 c.extend.httpData
I receive error SyntaxError: Unexpected token default while getting or setting attribute default on
For some reason, I'm getting this error message: Uncaught SyntaxError: Unexpected token < For
hello im am getting JS error : Uncaught SyntaxError: Unexpected identifier here <script type=text/javascript>
I keep getting an unexpected token script error in developer tools. (fixed) Now I
Hey guys! I keep getting a syntax error (unexpected $end), and I've isolated it
I am getting syntax error with the following statement REPLACE INTO users (screenname, token,
Getting the subdomain from a URL sounds easy at first. http://www.domain.example Scan for the

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.