我需要通过 ajax(不是 json)向另一个域提交表单,但不断收到错误消息
XMLHttpRequest cannot load http://some.other.domain/. Origin http://localhost:8081 is not allowed by Access-Control-Allow-Origin.
有没有办法解决这个问题?
$.ajax({
type: "POST",
dataType: "text/html",
data: $("#surveyForm").serialize(),
crossDomain: true,
url: "http://some.other.domain",
processData: false,
error: function (jqXHR, textStatus, errorThrown) {
},
success: function (response) {
}
});