REQUEST['callback'];
// Create the output object.
$output = array('a' => 'Apple', 'b' => 'Banana');
//start output
if ($callback) {
echo $callback . '(' . json_encode($output) . ');';
} else {
echo json_encode($output);
}
2. .net程序段返回的代码格式:
String jsonString = "{success: true}";
String cb = Request.Params.Get("callback");
String responseString = "";
if (!String.IsNullOrEmpty(cb)) {
responseString = cb + "(" + jsonString + ")";
} else {
responseString = jsonString;
}
Response.Write(responseString);
,220)/}
net,返回,后台,如何,数据