HTTP interface / requests status and JQuery
Posted: 17 Feb 2014 08:38
Hi, I am trying to get the status of the currently playing file. I want to use JQuery, so I can embed it in a webpage to build a custom remote control. If i use IE, i can get the status via http://myIP:8080/requests/status.json. I can also pass commands i.e. ?command=pl_pause. No problems when doing it via a web browser. However, if I try to use JQuery inside of Visual Studio, I have no luck. I have tried with the new version 2.1.3 (one that requires a password) and an older version 2.0.1.
I have connecting to 2 different machines. I have also uninstalled and re-installed numerous times. No problems if i put the command in the address bar of the web browser, though.
Here is the code I am using. I got it from another post a page back, but it isn't working for me.
Any help is appreciated.
Thanks.
checkConnection = function () {
//test user settings
$.ajax({
url: 'http://192.168.1.2:8080/requests/status.json',
beforeSend: function (xhr) {
xhr.setRequestHeader("Authorization", "Basic " + ":vlcplayer");
},
success: function (data, status, jqXHR) {
alert("yes");
},
error: function (data) {
alert("error");
}
});
};
I have connecting to 2 different machines. I have also uninstalled and re-installed numerous times. No problems if i put the command in the address bar of the web browser, though.
Here is the code I am using. I got it from another post a page back, but it isn't working for me.
Any help is appreciated.
Thanks.
checkConnection = function () {
//test user settings
$.ajax({
url: 'http://192.168.1.2:8080/requests/status.json',
beforeSend: function (xhr) {
xhr.setRequestHeader("Authorization", "Basic " + ":vlcplayer");
},
success: function (data, status, jqXHR) {
alert("yes");
},
error: function (data) {
alert("error");
}
});
};