Home:ALL Converter>Share Dynamic Data on Facebook and Twitter

Share Dynamic Data on Facebook and Twitter

Ask Time:2012-09-22T18:01:31         Author:Sana Joseph

Json Formatter

Is there some way to share some dynamic data from my page on facebook and twitter ?

I tried this code with static data and it worked, but I apply it dynamically it doesn't.

For Twitter:

<a href="http://twitter.com/share" 
data-text="What should I share?" 

For Facebook:

<a href="javascript:window.location=%22http://www.facebook.com/sharer.php?u=%22+encodeURIComponent(document.location)+%22&#38;t=%22+encodeURIComponent(document.title)" title="Share on Facebook..."><img src="/path/to/your/image/" width="12" height="12" alt="alt" /></a>

What am I doing wrong?

Author:Sana Joseph,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/12542784/share-dynamic-data-on-facebook-and-twitter