javascript - Google+ JS API trigger the interactive post button automatically -


i'm using google+ api. can render 'interactive post' button javascript described here: https://developers.google.com/+/web/share/interactive#rendering_the_button_with_javascript

so, code looks this:

var options = {     contenturl: myurl,     clientid: myclientid,     cookiepolicy: 'single_host_origin',     prefilltext: sometext,     recipients: somerecipients,     calltoactionlabel: 'view',     calltoactionurl: myurl };  gapi.interactivepost.render('gplus-share-trigger', options); 

but want trigger button automatically when finished rendering, there way detect that? dont want ugly like:

settimeout(function(){ $('#gplus-share-trigger').click(); },500); 

thanks

use:

var options = {     contenturl: myurl,     clientid: myclientid,     cookiepolicy: 'single_host_origin',     prefilltext: sometext,     recipients: somerecipients,     calltoactionlabel: 'view',     calltoactionurl: myurl,     callback: function(result) {         $('#gplus-share-trigger').trigger("click");     } }; 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -