Share this. If I had the below HTML in my DOM:
<a class="st_sharethis_custom button share-track tiny radius secondary share player-share">Share</a>
and it already gets bound, I cannot easily dynamically set the st_url unless I completely delete this from the DOM. So the below code is the only way I could figure out how to dynamically change URLs in the same button. I tried to unset st_processed. And also had issues using jquery's prop function. It seems somehow you guys will only pick up when the function attr() is called.
This is very frustrating of a work around to try to dynamically create a button! Please make developer experience better by producing some kind of article to swap out url's on the fly.
Thanks!
$('.share-this-player').html('<a class="st_sharethis_custom button share-track tiny radius secondary share player-share">Share</a>');
$('.player-share').attr('st_url', $('#full_uri').val() + current_slug_full_url);
$('.player-share').attr('st_title', 'adsfdsadasf sadf ');
try {
if (window.stButtons && window.stLight){
stButtons.locateElements();
var switchTo5x = true;
stLight.options({publisher:'XXXXXXXXX'});
}
} catch (e) { }