JQuery LinkedIn Button With Share Content

Prerequisite :

  1. Read Documentation at developer.linkedin.com
  2. Create an application follow developer @ linkedin
  3. Once application is created successfully, save your Client ID & Client Secret at secure location
  4. Post comments if you have any question on Prerequisite. Let jump on to topic


Create a  Custom Login Button :


<!DOCTYPE html>

<meta charset=’utf-8′ />


<button type=”button” class=”btn btn-lg btn-info linkedinShareButton”>
<i class=”icon icon-linkedin”></i>



Looks like below:




// Setup an event listener to make an API call once auth is complete
function onLinkedInLoad() {

// Handle the successful return from the API call
function onSuccess(data) {

// Handle an error response from the API call
function onError(error) {

// Use the API call wrapper to share content on LinkedIn
function shareContent() {
// Build the JSON payload containing the content to be shared
var payload = {
“comment”: “Check out developer.linkedin.com! http://linkd.in/1FC2PyG“,
“visibility”: {
“code”: “anyone”


$(document).on(“click”, “.linkedinShareButton”, function() {
IN.Event.on(IN, “auth”, onLinkedInLoad);

That it, Now go and check your post on LinkedIn.com, wait for couple of min to see your post on wall.

Let me know if you have any comments/ Suggestions and Appreciations 😉



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s