I need to convert a json return from php to asp classic. How can I do that?
In index.php
<script>
function (){
$.ajax({
url: ajax.php,
dataType: "json",
data: {
ROWID : rowid
},
success: function(data){
alert(data[0]);
}
});
}
</script>
In ajax.php
echo json_encode(array(
"TRUE"
));
return;
I will be getting a java alert messege 'TRUE'
what shall be in asp?
Response.Write json_encode(array(
"TRUE"
));
doesn't work. can't find a full solutuion to it. any ideas how shall I do it in asp classic?
AXE (ASP Xtreme Evolution) has some JSON libraries that might get you what you need.
See examples here
If you want to manage JSON like PHP does, with .NET, you have to use a librairy to do this (or write your own parse, but it's not a good idea).
You can search more information about this one: Newtonsoft.json
Thi is a good library that allow you to parse json into object, and object into json.
There is a way to convert to json with http://code.google.com/p/aspjson/