You need to sign in to do that
Don't have an account?

Salesforce Ajax call throwing exception
I have the following ajax call that I am sending to an outside domain. but it straights goes to error function is there something that I am missing . I have added the url into remote setting
<message collected>
error
<message collected>
$.ajax({ type: "POST", url: 'https://xxx.xxx.xxx/qualification', headers: {"Accept" : "application/json", "Content-Type": "application/json" }, data: JSON.stringify(address), crossDomain : true, dataType: 'json', success: function (responseData) { console.log(responseData); getAddresses(); }, error: function (request, status, error) { console.log(request.responseText); console.log(status); console.log(error); var result = $("#selections").append("Sorry, Something in the system has gone wrong , Please try again Later"); console.log("Sorry, Something in the system has gone wrong , Please try again Later"); } });the error "Sorry, Something in the system has gone wrong , Please try again Later" but in console I also get this. I am not sure if there anything script cdn i need to include or if the format is wrong. any hint is really appriciated
<message collected>
error
<message collected>
You're being blocked by the browser "Same origin policy". That is, you cannot do ajax requests to other than the same domain that the script was loaded from. There are, however, some workarounds:
Use JSONP. This is probably the most cross browser compatible solution
Configure your application to support CORS. This works in most modern browsers, but not in some older.
Create a proxy service on your own server. That is, mount an endpoint, e.g. /externalService that proxies the request on the server side to the remote endpoint. It also will work in all browsers, but will involve more work on the server side.
kinldy Refer the Below URL for Same Issue,
http://stackoverflow.com/questions/4613310/how-to-call-external-url-in-jquery
Hope this will help you.
Mark Best ANSWER if its works for you.
Thanks
karthik