0

I make an ajax call:

$.ajax({
    url: 'Login.aspx/AuthenticateRegularUser',
    type: 'POST',
    contentType: 'application/json; charset=utf-8',
    async: true,
    dataType: "json",
    data: '{ "emailAddress": "' + emailAddress + '","password": "' + password + '","verificationCode": "' + verificationCode + '" }',
    success: function(Result) {
        if (Result != "") {
            var ClientResponse = JSON.parse(Result.d);
            if (ClientResponse.Success) {
        //DO SUCCESS
            }

            else {
        //DO FAIL
            }
        }
    },
    error: function(xhr, textStatus, errorThrown) {
    //DO ERROR
    }
});

Most of the times everything is working fine, and I get success callback. But one of my clients has a problem that sometimes the operation completed successfully on the server, but I get an error callback with an empty error. jqXHR is empty, textStatus = "" and null errorThrown.

any idea why?

2 Answers 2

1

Could it be the different type of browser?? Could be an IE related issue. Maybe ask the client to use firefox instead.

Could be IE interpret javascript differently to firefox, I had similar sort of issue before at work. Microsoft always try to have its own standard for javascript, html, css. Also check data: '{ "emailAddress": "' + emailAddress + there are seems to have too many Quotation mark.

Thanks

Sign up to request clarification or add additional context in comments.

7 Comments

Possible, but do you have any idea why or what it means?
Could be IE interpret javascript differently to firefox, see my updated answer.
and it makes sense that most of the time it works that way (like 8 calls out of 10) but only a few times fail?
Tell your client to try firefox latest version, it be the answer for your problem.
I can't :) we support all browser types.
|
1

Try, need to remove ' infront of data and syntax like as mentioned below

 data: { "emailAddress": emailAddress, "password": password, "verificationCode": verificationCode },

instead of

  data: '{ "emailAddress": "' + emailAddress + '","password": "' + password + '","verificationCode": "' + verificationCode + '" }',

Ref: http://api.jquery.com/jQuery.ajax/

1 Comment

Thanks, I will try, but can you tell me why do you think it can be a problem?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.