Q:

Consuming OData Servie using DataJS

I have this javascript code in MVC view i try to call OData Service using Datajs :
$(document).ready(function() {
     var temp = OData.read("http://odata.netflix.com/v1/Catalog/Genres", function (data,  response) {
     var x = 3;

      });
});

i have a break-point on var x = 3; but unfortunately the break-point was never hit!  if i put break-point on OData.Read i can see its calling the OData-Service but then the callback function never get fired , i dont know what im doing wrong?

A:

Add this before calling OData.Read():
OData.defaultHttpClient.enableJsonpCallback = true;

Also your request doesn't specify format. Change the request string to: http://odata.netflix.com/v1/Catalog/Genres?$format=json&$callback=?callbackHere

