ShareThis property properties in callback do not work

I am using ShareThis widget. I need to change the url property after the object has been created, so I use the callback function function. In the callback function, I am trying to change the url property, but the remaining message still contains the old value.

Has anyone been able to solve this problem? If so, I would appreciate your help!

Here is a sample code

<script type="text/javascript">

      SHARETHIS.addEntry({
          title: 'ShareThis'},
    { onclick: myCustomCallback }

      function myCustomCallback(SharedObject) {

        SharedObject.properties.url = "http://www.myurl.com";
        return true;
    };

</script>
+3
source share
2 answers

URL- . - , URL-. , , , , - , URL-.

, HP . "share" Flash-, .

sragan@sharethis.com

+1

:

$('span[class^="st_"]').html(''); // Empty span contents

$('span[class^="st_"]').attr('st_processed',null); // Reset ST plugin

$('span[class^="st_"]').attr('st_url',url); // Set new url

stButtons.makeButtons(); // Renew buttons
+3

Source: https://habr.com/ru/post/1728537/


All Articles