0

I am getting data by verifying through "jsonp" but it is going to error.

$.ajax({
    type: 'GET',
    url: _BaseUrl,
    contentType: 'application/json;charset=utf-8',
    processData: false,
    crossDomain: true,
    dataType: 'json',
     success: function (data) {
            sourceGrid = data;
        return true;
    },
    error: function (jqXHR, textStatus, errorThrown) {
        alert(jqXHR.error);
        return false;
    }
});

Error is:

XMLHttpRequest cannot load url. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin url is therefore not allowed access.

user2178565
  • 41
  • 1
  • 1
  • 3
  • This is a possible duplicate of http://stackoverflow.com/questions/20433655/no-access-control-allow-origin-header-is-present-on-the-requested-resource-or. Sounds like you are doing a cross domain ajax call, you should find a suitable solution in the link provided. – Hidden Hobbes Oct 13 '14 at 07:25

2 Answers2

0

Please mention URL you are using for AJAX.. One reason could be you are using full url with http.. Try relative URL.

vineet verma
  • 185
  • 1
  • 10
0

I have got the answer.Need to call a class which contains in detail to allow access.

user2178565
  • 41
  • 1
  • 1
  • 3