jsonp support (thankxs fabrixxm)

This commit is contained in:
friendica
2014-10-16 02:02:11 -07:00
parent d4abc91d1f
commit e1f88fd15d
3 changed files with 6 additions and 3 deletions

View File

@@ -197,7 +197,10 @@ require_once('include/items.php');
case "json":
header ("Content-Type: application/json");
foreach($r as $rr)
return json_encode($rr);
$json = json_encode($rr);
if ($_GET['callback'])
$json = $_GET['callback']."(".$json.")";
return $json;
break;
case "rss":
header ("Content-Type: application/rss+xml");