How can i rerender Pinterest's Pin It button?

前端 未结 13 2455
暖寄归人
暖寄归人 2021-01-30 18:14

I\'m trying to create and manipulate the Pin It button after page load. When i change the button properties with js, it should be rerendered to get the functionality of pinning

13条回答
  •  忘掉有多难
    2021-01-30 18:48

    The best way to do this:

    1. Remove the iframe of the Pin It button you want to manipulate
    2. Append the html for the new button manipulating it as you wish
    3. Realod their script - i.e. using jQuery:

      $.ajax({ url: 'http://assets.pinterest.com/js/pinit.js', dataType: 'script', cache:true});
      

提交回复
热议问题