I currently have a site that includes the Google Share button (along with Facebook and Twitter) on a social networking widget that I'm creating. What I would like to do is to be able to type some text in a textarea field, and upon pressing a 'Send' button, the text is shared to a Google+ user's wall (I already have Facebook and Twitter posts working). Now I know there is a field for Google+'s share button called 'data-prefilltext', and this is the field that I'm trying to set with the message from the textarea. When I press the 'Send' button, I can see the 'data-prefilltext' field value change, but in the popup window, I do not see the text change. Below is the code:
HTML:
<div id="googleplus-selector" title="App is what's new! Share it with your circles in Google+"
class="social-networking-icons g-interactivepost"
data-contenturl="http://plus.google.com/pages/"
data-contentdeeplinkid="/pages"
data-clientid="clientid.apps.googleusercontent.com"
data-scope="https://www.googleapis.com/auth/youtube.readonly"
data-cookiepolicy="single_host_origin"
data-prefilltext="Share App with your circle of friends now!"
data-calltoactionlabel="TRY_IT"
data-calltoactionurl="http://plus.google.com/pages/"
data-calltoactiondeeplinkid="/pages/create"
data-href="http://mysiteurl">
<div class="widget-mask"></div>
</div>
Javascript/jQuery:
var textElement = $('#social-message-text');
var text = textElement.val();
$('#google-plus-share-button').attr('data-prefilltext', text);
Like I said, I can see the attribute's value change upon inspection the element within Firebug or Google's Developer Console, however that change in text isn't reflected when the Google Share popup window is opened.
Any help would be greatly appreciated as I'm a bit stumped at the moment. Thank everyone in advance.