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

jquery.ajax in Visualforce
I don't konw whether there are some error in my code, so does anyone have experiences about use jquery.ajax in Visualforce or how to post a request to an external service in Visualforce?
When this code execute, I receieve the response with error method: textStatus : error XMLHttpRequest.readyState : 0 XMLHttpRequest.status : 0
When this code execute, I receieve the response with error method: textStatus : error XMLHttpRequest.readyState : 0 XMLHttpRequest.status : 0
$.ajax({ type: "POST", url: 'https://www.me.com/qualification', // outside Domain 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"); } });
Hi
I tried your request and I am getting below error:
Try opening developer console to see error something like this
Either your rest service is not proper or the brower is restricting the service giving cross-origin frame error.
Thanks
If you're satisfied with the answers provided, please don't forget to select a Best Answer.