views:

110

answers:

1

I'm using the ShareThis widget. I need to change the url property after the object has been created so I'm using the callback function option. In the callback function, I attempt to change the url property but the email that goes out still contains the old value.

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

Here's a code sample

SHARETHIS.addEntry({ title: 'ShareThis'}, { onclick: myCustomCallback } function myCustomCallback(SharedObject) { SharedObject.properties.url = "http://www.myurl.com"; return true; };
A: 

It's not possible to change the URL dynamically. If you want to do something funky, you'll need to create a new button with the new URL. This can be accomplished a few ways, the simplest being creating an element to contain the button and trigger creation of a custom button element every time something happens that should trigger the URL change.

I can show you a sample implementation that we put together for HP a few weeks ago. They actually call the "share" function from inside a Flash movie, but this prototype triggers it from a button.

You can reach me at [email protected]

Steve R