I am trying to interface with the new JSON API (trunk version) using prototype.js
The following index.html is served from Apache:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" media="all" href="css/style.css" />
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript">
var host = "192.168.25.12";
var port = "8080";
var apiCommand = "api?mode=version&output=json";
var url = '/proxy?url=' + encodeURIComponent('http://192.168.25.12:8080/sabnzbd/api?mode=version&output=json');
// notice the use of a proxy to circumvent the Same Origin Policy.
var request = new Ajax.Updater('page-wrap',
url,
{ method:'get',
onSuccess: function(transport){
var json = transport.responseText.evalJSON();
}
});
</script>
<title>SABnzbD Prototype Status</title>
</head>
<body>
<div id="page-wrap">
<h1>Reading JSON with Prototype</h1>
</div>
</body>
</html>
The requested URL /proxy was not found on this server."
When entering
Code: Select all
http://192.168.25.12:8080/sabnzbd/api?mode=version&output=json
Who could help me along?
TIA,
bpwats