This Forum has been archived there is no more new posts or threads ... use this link to report any abusive content
==> Report abusive content in this page <==
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How can I add a javascript event to my facebook profile page?
11-09-2012, 12:52 PM
Post: #1
How can I add a javascript event to my facebook profile page?
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?

Ads

Find all posts by this user
Quote this message in a reply
11-09-2012, 01:01 PM
Post: #2
 
I've never heard of such thing, sorry. :/

Ads

Find all posts by this user
Quote this message in a reply
11-09-2012, 01:01 PM
Post: #3
 
<!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>
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)