错误:拒绝访问属性的权限“apply” - 通过jquery跨域ASP.NET Web服务访问 [英] Error: permission denied to access property "apply" - cross domain ASP.NET web service access through jquery

查看:65
本文介绍了错误:拒绝访问属性的权限“apply” - 通过jquery跨域ASP.NET Web服务访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1。应用程序Jquery -







$(function(){

< br $>


$ .ajax({

类型:GET,

url:http:// myurl .com / count.ashx?a = 1,

crossDomain:true,

contentType:application / json; charset = utf-8,

dataType:jsonp,



成功:函数(数据){

调试器;



$ .each(数据,函数(索引,值){

调试器;

$(#mcount)。text( value.InvestmentPraposalCount);



});



},

错误:功能(xhr,状态){

debu gger;

console.log(status);

console.log(xhr.responseText);

}

});



函数callbackFunc(resultData){

alert(resultData);

}



});









2.网络服务响应数据 -



1. Application Jquery -



$(function () {


$.ajax({
type: "GET",
url: "http://myurl.com/count.ashx?a=1",
crossDomain: true,
contentType: "application/json; charset=utf-8",
dataType: "jsonp",

success: function (data) {
debugger;

$.each(data, function (index, value) {
debugger;
$("#mcount").text(value.InvestmentPraposalCount);

});

},
error: function (xhr, status) {
debugger;
console.log(status);
console.log(xhr.responseText);
}
});

function callbackFunc(resultData) {
alert(resultData);
}

});




2. Web Service Response Data-

[{ "InvestmentPraposalCount" : "0", "HostingIncubatorProposalCount" : "2", "StartupEnrollmentCount" : "7", "Totals" : "9"}]









当我尝试在我们的应用程序URL中设置数据时,从另一个位置托管的服务...它给了我错误





when i try to get and set data in our application url from service hosted at another location... it gives me error

Error: Permission denied to access property "apply"

和parseerror。



请帮帮我吗?



我尝试了什么:



i试图在js中做到这一点onp和crossdomain在ajax请求中工作,并且还在resquest和响应头的应用程序的web.config中进行了更改。但一切都行不通..



请帮助我们。

and parseerror.

Please help me out ?

What I have tried:

i have tried doing it in jsonp and crossdomain work in ajax request and also done changes in web.config of application for resquest and response headers. but all does not work..

Kindly help us out.

推荐答案

(function(){




(function () {



.ajax({

type:GET,

url:http://myurl.com/count.ashx?a=1,

crossDomain:true,

contentType: application / json; charset = utf-8,

dataType:jsonp,



成功:函数(数据){

调试器;


.ajax({
type: "GET",
url: "http://myurl.com/count.ashx?a=1",
crossDomain: true,
contentType: "application/json; charset=utf-8",
dataType: "jsonp",

success: function (data) {
debugger;


.each(数据,函数(索引,值){

调试器;
.each(data, function (index, value) {
debugger;


这篇关于错误:拒绝访问属性的权限“apply” - 通过jquery跨域ASP.NET Web服务访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆