Jquery 如何向json服务器发出CORS ajax post请求

Jquery 如何向json服务器发出CORS ajax post请求,jquery,ajax,Jquery,Ajax,我试图在下面的代码片段中使用jquery ajax向json服务器发出跨域POST请求: var URL = $("#postUrl"); $.ajax({ url: URL, data: { "id": 8, "first_name": "Mark", "last_name": "Green",

我试图在下面的代码片段中使用jquery ajax向json服务器发出跨域POST请求:

          var URL = $("#postUrl");
          $.ajax({
            url: URL,
            data: {
                "id": 8,
                "first_name": "Mark",
                "last_name": "Green",
                "phone": "409-324-1345",
                "email": "mark@nexware.com.ng",
                "prefered_exam": "NECO",
                "institution": "greenchamber"
            },
            processData: false,
            type: 'POST',
            async:true,
            crossDomain:true,
            dataType:"json",
            contentType:"application/json; charset=utf-8",
            accepts:{
              "*": "*/*",
              text: "text/plain",
              html: "text/html",
              xml: "application/xml, text/xml",
              json: "application/json, text/javascript"
            },
            success: function ( data ) {
                alert( data );
            }
        });

这似乎除了刷新页面之外什么都不做。有人请帮我指出正确的方向

你有权访问服务器代码吗?没有,只有API我相信你不能发布“json”ajax帖子。。我读了一些关于“jsonp”的文章,但是如果你发现了什么,你需要修改服务器。请分享Answear。我明白了,但是,我使用了curl,它可以工作,我也使用了postman工具,它也可以工作,但是ajax不起作用。postman可以对curl发出相同的CORS请求,但是javascript受到浏览器的限制。。你可以在谷歌chrome开发工具中找到这个,但不适合生产