onur onur - 1 year ago 89
Ajax Question

How can i rerender Pinterest's Pin It button?

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 dynamically loaded images. So, does Pinterest have any method like Facebook's B.XFBML.parse() function?


Answer Source

Just add data-pin-build attribute to the SCRIPT tag:

<script defer

That causes pinit.js to expose its internal build function to the global window object as parsePinBtns function.

Then, you can use it to parse links in the implicit element or all of the links on the page:

// parse the whole page

// parse links in #pin-it-buttons element only

Hint: to show zero count just add data-pin-zero="1" to SCRIPT tag.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download