Ajax call to get Json from MVC3 controller

I hope someone out there can help me. I am trying to do a very basic thing: use jQuery to get Json from the MVC3 controller. The controller returns a Json penalty if I call the URI directly http://www.youtipit.org/api/GetTipitByUrl?url=http://utipi.it/t/1834 from the browser, but I get an empty result (in Firebug), when i try to do the following:

$.getJSON( 'http://www.youtipit.org/API/GetTipitByUrl?url=http://www.youtipit.org/t/J1833', null,

                 function(data) {

                   if (data) {
                     alert('It Works!!');
                     alert(data);
                   }
                 });

In firebug I get code 200, but the answer is empty. I am sure there is something simple that I can do in my Javascript to get this to work, but I am new to this.

+5
source share
1 answer

, . www.youtipit.org, AJAX. :

  • JSONP ( JSON), JSON . . API, . url, , JSON.
  • JSONP, XML JSON, , . AJAX , , , HTTP- WebClient.
+4

All Articles