Post a Message on a Facebook Wall with JavaScript | WebReference | 2 | WebReference

Post a Message on a Facebook Wall with JavaScript | WebReference | 2


[prev]

Posting Messages from JavaScript

Posting messages from JavaScript is the easiest part. Here are the steps you have to follow:

  1. Include the following code before closing the body block().
  2. Change the following details based on your app and the page you will be posting from:

    • line 12: href should take the value of the page that you want to link to. Usually it will be the current page's URL.
    • line 21: you need to enter the Application ID that Facebook generated for your app.
  3. Call publishOnFb(). The only thing to do now is to call the JavaScript function to publish on Facebook. Create a link like the following:

Original: April 20, 2011

[prev]