Dynamic linkedin button is not showing


Oh it’s nightmare! Linkedin share button is not showing up when I load the page content in Ajax. It’s not new to hear!. We always face this kind of issue on every social media buttons  when we do fancy Ajax things with twitter, facebook, etc. But facebook and twitter is some what smart to handle. Linkedin throwing exception  like below when we load “in.js” in Ajax page content.

duplicate in.js loaded, any parameters will be ignored

We just need to check the Linkedin JS is already loaded or not. Below script will make sure Linkedin script duplicate issue. So it did the magic to solve the issue on Ajax content loading. Are done? No. I also try to create the Linkedin button dynamically using Javascript. That eats my hours by frustration.

	if (typeof (IN) != 'undefined') {
  		// IN.parse(); // old but still supports
 		IN.init(); 	// reinitiating linkedin button  
	} else {






 Photo credit: Marvin Lee (Creative Commons)

When I create the dynamic Linkedin button above trick doesn’t give me hand to solve. But when I do some more research on it. Just found that we can flush the old Linkedin instance by “delete IN;”. So below one works.

delete IN;

Hope it helps, cheers!

Posted in jQuery and tagged , by .

About Gowri

I am professional web developer with 8+ years experience. PHP, jQuery, WordPress, Angular and Ionic are my key skills in web development. I am working with strong enthusiastic team with spirit. We provide all web related solution like HTML/CSS development, Web graphic design and Logo.

2 thoughts on “Dynamic linkedin button is not showing

  1. Mike Wayne

    You are a js god my friend.
    I looked everywhere for this solution and I could not find it anywhere, except for here.

    We spent a good 10 hours trying to figure out how to load this linkedin button while using jquery.

    This worked perfectly. Thank you!

  2. Bjrn

    Thanks, looked all over the place for this.
    I used the async script:

    $(function() {
    delete IN;
    $.getScript("http://platform.linkedin.com/in.js?async=true", function success() {
    onLoad: "onLinkedInLoad",
    api_key: "api_key",
    authorize: true,

Comments are closed.