Read JSONP Response in Dev Environment :- Uncaught SyntaxError: Unexpected token :"

18 views Asked by At

In my local m/c I am trying to validate the User by passing his details to a Cross-domain Url. On browser Console Log I get error "Uncaught SyntaxError: Unexpected token :" and when i click on it I get {"response": "PASS"}.

jQuery.ajax({
    type: 'GET',
    dataType: 'JSONP',
    url: 'https://my.site.com/validation.xml',
    jsonpCallback: 'callback',
    jsonp: false,
    data: {
        accountnumber: ActNumber                
    },
    timeout: 60000,
    success: accountValidationResponse,
    error: accountValidationError
});
https://my.site.com/validation.xml'?callback=jQuery22409542193305264031_1483533842731&accountnumber=12345678&_=1483533842732

Changing the dataType to json gives me this error:

No "Access-Control-Allow-Origin' header is present on the requested resource

0

There are 0 answers