BASSI3 Wrote:Hi, I'd like to make my own web interface for xbmc and read through the wiki on the JSON-RPC. After that, I wrote a small script as a basis to communicate with XBMC.
Code:
var xhr = new XMLHttpRequest();
xhr.open("GET", "http://IP:8080/jsonrpc");
xhr.onload = function(){ console.log(xhr.responseText) }
xhr.send();
When I load this script into Chrome, it tells me that Origin null is not allowed by Access-Control-Allow-Origin and won't execute the request. The problem is that the domain which forms the origin of the request differs from the domain of the resource and that's not allowed.
What I just need is a little 'hello world' example of how to communicate with xbmc and I'll be ready to go.
Thanks in advance!
This is a security issue.
Ajax will not make calls outside your domain.
You can fix this by making a php proxy file.
See
http://jquery-howto.blogspot.com/2009/04...query.html for more information.
OK, for my question.
Now that I can load http:192.168.0.1:8080/jsonrpc what the hell do I do next? I have a controller working using the depreciated "xbmcCmds/xbmcHttp?command=" format, but I now want to do the same with JSON.
When I try anything, all I get back is "JSONRPC active and working"
How do I get JSON data out of the XBMC using java?
I'm sure it's simple, but having never used JSON before, I'm at a loss.