I'm trying to make a SmartTV application which has to request it's channel list from some url.
When it does, I'm not receiving response text while seeing the expected content length. jQuery.ajax throws some error with status 0. However, when opening the same URL through browser, I'm receiving the expected response.
The only difference I've found so far is that browser is able to set a cookie received and then can send it back. But SmartTV app is like another web-site that does cross-domain ajax request. It receives cookie in response but doesn't set it (or at least it doesn't send it back when needed).
jQuery.ajax({
url: 'http://url...',
data: "",
dataType: 'xml',
success: function (output, status, xhr) {
alert(output);
},
error: function(xhr, ajaxOptions, thrownError) {
alert("xhr " + xhr.status);
alert("error " + thrownError);
},
crossDomain: "true"
});
Is it possible to use jquery the way I'm using it here? If not, what the other way to get that response and set the correct cookie?
Edit: it appears to be that it is not the issue of any cookies. I've created an interface WebAPI which my app is requesting. That WebAPI is able to get the proper result and then send it as plain text to SmartTV app. Result at the app side is the same - in response headers I see expected content length, but no content. Fun thing is that I testing that app as a plain web site in IE also, not on some glitchy SmartTV. What did I do wrong if jQuery.ajax doesn't return response body?
Edit 2: Oh, well, same origin policy...