Gaurav Gupta

Gaurav Gupta

  • NA
  • 58
  • 789

Error: permission denied to access property "apply"

Jan 3 2017 12:59 AM

Error: permission denied to access property "apply" - cross domain ASP.NET web service access through jquery

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"}]
 
 
 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"
 and parseerror.
 
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..
 
 

Answers (1)