我想在我的网站中显示来自:https://graph.facebook.com/comments/?ids=http://lujanventas.com/test.php的内容。
除了AJAX调用之外我该怎么做?可以在没有JS的情况下完成吗?
答案 0 :(得分:1)
您可以创建一个服务器端脚本来读取文件的内容并回显它
这是php中这样的脚本的一个例子:
$ids = "http://lujanventas.com/test.php";
$url = "https://graph.facebook.com/comments/?ids=".urlencode($ids);
$data = json_decode(file_get_contents($url),true);
foreach($data[$ids]["comments"]["data"] as $comment){
echo $comment["message"]."<br /><br />";
}