homepage Welcome to WebmasterWorld Guest from 54.161.155.142
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
How reliable is Google 1+ callback function
Just try to use 1+ to unlock content
jetteroheller




msg:4340618
 10:17 pm on Jul 17, 2011 (gmt 0)

<g:plusone callback=gp1cb></g:plusone>

and in the javascript

gp1t=new Array();

function gp1cb(gp1v)
{
alert(gp1v.href);
gp1t[gp1v.href]=gp1v.state;
}

Sometime it works, sometime it does not work.

I can not find anything wrong.

I give a plus 1, and sometimes the callback function is not called
I take a plus 1, and sometimes the callback function is not called
but the 1+ button count reacts on my action.

 

jetteroheller




msg:4340686
 6:19 am on Jul 18, 2011 (gmt 0)

Load sequence matters!

All my successfull tests had been with 1+ buttons
rendered by javascript on demand

This means I created them after the web site was loaded

All unsuccessfull tests had been with buttons built into the page

Now I moved function gb1cb used for the callback parameter
into the head section of the page. Now it works like expected

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved