Social plugins re-parsing
You might need to change the link of the like/share buttons in your page in real time.
In this case you need to reload the social plugin using the following methods.
// Twitter
twttr.widgets.load();
// Facebook
// general to all elements in the page
FB.XFBML.parse();
// single element with an id
FB.XFBML.parse(document.getElementById('element_id'));
// G+
gapi.plusone.render('element_id', {
'size' : 'medium'
// options as you need them
});
//Pinterest
$.ajax({ url: 'http://assets.pinterest.com/js/pinit.js', dataType: 'script', cache:true});
Written by Paolo
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Parse
Authors
Related Tags
#parse
#html
#twitter
#facebook
#iframe
#social button
#googleplus
#pinterest
#javascript
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#