Hello,
Please, point me out to documentation, manual, examples of using the JSONRequest object and its functions.
The information found in the Reference is not sufficient and understandable without examples, which I did not find. There is a JSON file at examples/data/gridData.txt but I could not discover which example makes use of it.
When I try to use JSONRequest like:
(replace example.com with your real host, e.g. localhost:8080)
I am getting nothing back. I cannot see even the first alert in the jsonResult function.
I can still read json with the usual xmlhttprequest as a text and eval() it but what the point of JSONRequest then?
P.S. JSONRequest does not support local files because file system does not return http OK status (200). However, the file is read but not evaluated due to the above reason.
P.S.S. It seams that the problem happens on line 214 in json.js. Unfortunately, the called function there does not return any exceptions and does not have any other (like initiating get request) visible for me effects.
If I use a protocol in a URI, e.g. http://..., the function seams do nothing . If I skip a protocol then the location is resolved to the local drive, which is not a correct destination neither.

using JSON library
27 February, 2008 - 11:02 — TedBeerHere it is code for your JSON test html page:
<title> JSON test </title>
<script type="text/javascript" src="/engine/lib/json.js"></script>
</head>
<body>
<script type="text/javascript">
<!--
try{
// it throws an exception
var iRequest = JSONRequest.get("http://nsk/test/json.php")
} catch( err){
console.dir( err)
}
//correct call
var iRequest = JSONRequest.get("json.php",
function(iRequestNumber, Data, Err){
if(Err)
console.warn( Err)
else
console.dir( Data)
})
//-->
</script>
</body>
</html>
Only acceptable content type is 'application/jsonrequest'
Here it is PHP test file(json.php):
header("Content-Type:application/jsonrequest");
?>
{"test_object" : "test response"}
JSON documentation
27 February, 2008 - 11:05 — TedBeerHere it standard API for JSONRequest
http://www.json.org/JSONRequest.html
Thanks for the intensive
27 February, 2008 - 14:10 — Mr.WoolfThanks for the intensive help;)
We have used json.org as a guidelines for our previous version of a product but apparently not fully followed the standard.