How to render linkedin button in a dynamic way? e.g. writing the "<script type='in/share'></script>" at runtime or after the page has finished loading. I already tested on writing it or appending it in the body tag using jquery but it doesn't work. I'll appreciate any help. thanks.
For anyone still wondering how to do this, after you load your
<script type="IN/Share"></script> //Don't forget other attributes
Just call IN.init() in your javascript and it will render the buttons.
The Developer guide does say something about using undocumented functions, but this forum post on the developer site:
https://developer.linkedin.com/forum/3-problems-share-button
As stated by Eugene O'Neill (Web Developer for LinkedIn)
1) IN.Parse() and IN.Init() are here to stay. While we do employ the policy that any undocumented methods may or may not be supported indefinitely, these two are uniquely crucial to the functionality of the framework. The amount of work it would require to remove IN.Parse()... I don't even want to think about it ;). IN.Init() is our preferred method for loading the framework asynchronously and won't be going anywhere. Feel free to use either method.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With