尝试从我的公司网站 POST 和 XML 到 FRESHDESK API 时出现此错误
这是javascript
$(document).ready(function(){
var data =
'<helpdesk_ticket>' +
'<description>This is a test</description>' +
'<email>sample@example.com</email>' +
'</helpdesk_ticket>'
$.support.cors = true;
$.ajax({
url: 'http://onehouse.freshdesk.com/helpdesk/tickets.xml',
type: 'POST',
crossDomain: true,
data: data,
dataType: "text",
username: 'MY API CODE',
password: 'X',
success: function (result) {
alert(result);
},
});
完整的错误是
XMLHttpRequest cannot load http://onehouse.freshdesk.com/helpdesk/tickets.xml. Origin http://localhost:3000 is not allowed by Access-Control-Allow-Origin. contacts?oid=00DU0000000I430&retURL=http%3A%2F%2Fwww.ironridge.com&email=ma…utes%5D%5Bdescription_html%5D=safsadfsdaf&00NU0000002xpYP=&submit=Submit:1
有没有人对此有任何解决方案........它不会将数据发布到 FRESHDESK 网站,而且我这几天一直在敲我的脑袋