Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

Web API is not calling from different domain

$
0
0

Hi Team,

I have created web api with simple return list if this adding in the same project then working its fine, but if when add this web api in different solution with different url then not working, even header is returning response ok with 200 but json data is not comming and always goes in error part from json below are the code for this,

$(function() {
        $.ajax({
            type: "GET",
            url: "<<url>>",
            dataType: 'jsonp',
            data: {},
            contentType: "application/json;charset=utf-8",
            success: function (data) {
                alert('success');
               // alert(data);
                //  $("#chart").append(JSON.stringify(parameters));
            },
            error: function (jqXHR, textStatus, errorThrown) {
                debugger;
                alert(jqXHR.status);
            }
        });
    });

Do you have any solution for this? is that something required for cross domain or something enable at server end for jsonp at server end.

Thanks,

Amit P.


Viewing all articles
Browse latest Browse all 4850

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>