Error Status 0. Message [object] [object]

$(document).ready(function() {
    //                 $(document).ajaxError(function (e, jqxhr, settings,     exception) {
    //                     if (jqxhr.readyState == 0 || jqxhr.status == 0) {
    //                         return; //Skip this error  
    //                     }
    //                 }); 
    $.ajax({
        url: "http://api/SendSMS",
        type: "POST",
        crossDomain: true,
        data: JSON.stringify({
            'Username': 'xxx',
            'Password': 'xxx',
            'Tagname': 'xxx',
            'RecepientNumber': 'xxx',
            'VariableList': '',
            'ReplacementList': '',
            'Message': 'test'
        }),
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        //data: send,
        error: function(xhr, error) {
            alert('Error!  Status = ' + xhr.status + ' Message = ' + xhr);
        },

        success: function(data) {
            alert('msg');
        }
    });
    return false;

});

I am trying to post credentials to access an API and send sms from my app using HTML5. But i get error status 0 Message object object. i also have cross domain : true, what is the issue please help. Thanks.


Source: json

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.