By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,950 Members | 1,035 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,950 IT Pros & Developers. It's quick & easy.

Error in calling WEB API Method

P: 7
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

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. function GetAllEmployees() {
  3. jQuery.support.cors = true;
  4. $.ajax({
  5. url: 'http://localhost/virtusapi/sublocation/GetAllTables/1',
  6. type: 'GET',
  7. dataType: 'jsonp',
  8. success: function (data) {
  9.  
  10. for (var i = 0; i < data.length; i++) {
  11. var course = data[i];
  12. alert(course.Name);
  13. }
  14. },
  15. error: function (x, y, z) {
  16. alert(x + '\n' + y + '\n' + z);
  17. }
  18. });
  19. }
  20.  
  21. </script>
Any one tell me where I am wrong.
Oct 4 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.