Twitist Forums
How can I add a javascript event to my facebook profile page? - Printable Version

+- Twitist Forums (http://twitist.com)
+-- Forum: Facebook forums (/forum-14.html)
+--- Forum: Facebook profile (/forum-15.html)
+--- Thread: How can I add a javascript event to my facebook profile page? (/thread-27806.html)



How can I add a javascript event to my facebook profile page? - confused - 11-09-2012 12:52 PM

How can I add an event to my facebook profile page such that when I share a fanpage and I click on its image, the event is triggered?


- Jaspar paul - 11-09-2012 01:01 PM

I've never heard of such thing, sorry. :/


- Asif - 11-09-2012 01:01 PM

<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> </head> <body> <div id="fb-root"></div> <script type="text/javascript"> window.fbAsyncInit = function() { FB.init({ appId: '207712505927107', status: true, cookie: true, xfbml: true }); /* All the events registered */ FB.Event.subscribe('auth.login', function(response) { // do something with response login(); }); FB.Event.subscribe('auth.logout', function(response) { // do something with response logout(); }); FB.getLoginStatus(function(response) { if (response.session) { // logged in and connected user, someone you know login(); } }); }; (function() { var e = document.createElement('script'); e.type = 'text/javascript'; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; e.async = true; document.getElementById('fb-root').appendChild(e); }()); function login() { FB.api('/me', function(response) { document.getElementById('login').style.display = "block"; var loggedInMessage = response.name + " successfully logged in!"; document.getElementById('login').innerHTML = loggedInMessage; }); } function logout() { document.getElementById('login').style.display = "none"; } //addevent to facebook profile function addevents() { FB.api('/me/events', 'post', { name: "JS-SDK Event", start_time: 1272718027, location: "Beirut", privacy_type: "OPEN" }, function(resp) { alert(resp.id); }); } </script> <p> <fb:login-button autologoutlink="true" perms="email,user_birthday,status_update,publish_stream,create_event"> </fb:login-button> </p> <p> <a href="#" onclick="addevents(); return false;">Add Events</a> </p> <br /> <br /> <br /> <br /> <div id="login" style ="display:none"></div> <div id="name"></div> </body> </html>