Error in calling WEB API Method

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kotireddy
    New Member
    • Sep 2012
    • 7

    Error in calling WEB API Method

    Hi,

    I am calling the web api get method in the browser it is working fine.but I trying to call this in asp.net page it is asking the follwing in IE.

    "This page is accessing inofrmation that is not under its control.This process a security risk.Do you want to continue?"

    Where as in the Firfox or crome. it is not working. My code is below

    Code:
    <script type="text/javascript">
    function GetAllEmployees() {
    jQuery.support.cors = true;
    $.ajax({
    url: 'http://localhost/virtusapi/sublocation/GetAllTables/1',
    type: 'GET',
    dataType: 'jsonp',
    success: function (data) {
    
    for (var i = 0; i < data.length; i++) {
    var course = data[i];
    alert(course.Name);
    }
    },
    error: function (x, y, z) {
    alert(x + '\n' + y + '\n' + z);
    }
    });
    }
    
    </script>
    Any one tell me where I am wrong.
    Last edited by Meetee; Oct 4 '12, 06:49 AM. Reason: use code tags around your code
Working...