2011-12-10 63 views
1

我怎樣才能檢索使用JSON獲取FB的訪問令牌使用JSON在客戶端

我的示例代碼

test.js(客戶端)

function(){ 
$.getJSON("https://graph.facebook.com/oauth/authorize?client_id=appid&redirect_uri=http://domain.com/sample/index.php", function(data) { 
    alert(data.userName); 
}); 
} 

的index.php我的數據(服務器方)

<?php 
    $aReturn['userName'] = "carlo2893"; 
    echo json_encode($aReturn); 
?> 

但它不返回任何。

回答

相關問題