使用jquery ajax调用外部Web服务时出现“访问被拒绝”错误消息

时间:2014-02-19 09:03:30

标签: jquery ajax

我在Jquery的代码是:

var accessUrl = 'testurl';
         var accessApplication = 'testapplication';


$.ajax({
             type: "POST",
             url: 'http://www.serveripaddress.com/Service.asmx/InsertAnalytics',
             //                    data: "{ 'URL': + $(this).context +','+'ApplicationName='+ $(this).context.innerHTML }",
             data: "{URL:'" + accessUrl + "', ApplicationName:'" + accessApplication + "'}",
             contentType: "application/json; charset=utf-8",
             dataType: "json",
             async: true,
             success: function(data) {
                 //debugger;
                 alert('success.');
             },
             error: function() {
                 // // debugger;
                 alert('Failed');
             }
         });

0 个答案:

没有答案