페이스북 개편되면서 방식이 바뀌었어요 ㅇㅇ
<!DOCTYPE html> <html> <head> <style type="text/css"> .login{} .write{display:none} </style> <script type="text/javascript" src="/js/jquery-1.4.4.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ }); </script> </head> <body> <div id="fb-root"></div> <script src="http://connect.facebook.net/en_US/all.js"></script> <script> FB.init({ appId : '126292714090241', status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); FB.login(function(response){ if (response.session){ $(".login").hide(); $(".write").show(); $("#btnMessage").click(function(){ $(".write").hide(); $(".message").html("글쓰는 중!!!"); var message = "아이유의 I Believe~!"; var picture = "http://profile.ak.fbcdn.net/hprofile-ak-snc4/hs625.ash1/27538_121461621211921_7447_n.jpg"; var link = "http://todayhumor.co.kr/board/search_view.php?table=humorbest&no=321269"; var source = "https://t1.daumcdn.net/cfile/tistory/131B54424D1DEEB51C"; var name = ""; var description = ""; var type = "swf"; FB.api("/me/feed", "post", {message:message, picture:picture, source:source, link: link, name: name, type: type }, function(response){ $(".message").html(""); $(".write").show(); if (!response || response.error){ alert("Error occured: " + response.error.message); } else { alert("Post ID: " + response + ", 글쓰기 완료~!"); } }); }); } else { alert("로그인 취소!"); } }, {perms:"read_stream, publish_stream, offline_access"}); </script> <div class="login"> </div> <div class="write"> <input type="button" id="btnMessage" value="글쓰기"/> </div> <div class="message"> </div> </body> </html>