Loading mulitple LinkedIn share buttons dynamically and asynchronously

后端 未结 3 856
遥遥无期
遥遥无期 2021-01-19 19:35

I have a page showing thumbnails of posts. The posts are fetched via AJAX and a filter allows for different posts to be fetched. When a thumbnail is clicked, a carousel open

3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-19 20:30

    If you look at the script you're running, you'll see that the results of the .getScript isn't being loaded into the script tag or anything like that, but rather you're essentially performing two seperate actions: loading the script and then creating the tag with type="IN/Share". The initial action, loading the script, only needs to be run once, as you've discovered, so you just need to run that .append line to create whatever dynamic buttons you want and then call IN.parse() to link the script to the newly created elements.

提交回复
热议问题