Gravatar
Wednesday, July 6th, 2011

Google +1 Button Javascript Conflict

 

An image of the Google +1 button The following is a quick heads up to any designers out there who like me may wish to protect what little hair they have left from being pulled out. It turns out the Google +1 (aka “PlusOne”) button conflicts with the Javascript onMouseMove(event). This is not my cup of tea but I know our in-house programmer has a headache from this and there is a handy thread at Google for interested parties to follow who may be facing the same issue. I know John Mueller has received notice of the issue so hopefully there will be a fix soon.

To quote “Fine Art America” who started the support thread at Google Webmaster Central, this is the issue:

{ Warning Tech Jargon commencing… now }

I use setTimeout to include plusone.js after four seconds. In the first four seconds, you can move your mouse around and the screen will show the coordinates just fine. After four seconds, the plusone.js script executes… the plusone button appears… and the mouse’s clientX and clientY parameters instantly become “undefined”.

That’s it – the plusone script killed them.

I did this with setTimeout just to illustrate the point. If you include plusone.js right from the beginning, then clientX and clientY will never work.

Plusone.js is definitely causing this.

As I understand it this won’t be an issue for a great many people but I don’t understand it very well (LOL) so I am open to your thoughts on this. Do you have an issue with the PlusOne button on your site? If so, please share it here!

 


4 Responses to “Google +1 Button Javascript Conflict”

  1. Bui Xuan Thanh

    Hi,

    I have just added +1 button in my site(http://www.nhakhoabaominh.com),
    The button was not displayed because It was conflicted with prototype. You can solve this issue by downloading the latest version of prototype.

    Hope it can help!

  2. alarm sistemleri

    I wonder if it also has a dislike feature which is frequently abused for example on YouTube. I understand that any rating counts for more than no rating but rating with the intention to do harm rather than good to someone is pathetic.

    We will try to get as much as +1 we can because we know the benefit of it with seo prespective (and soon we will see many people started to sell +1 as well) but a normal user do not know about it and where facebook like button is one step ahead from it.

  3. yahoo

    I really enjoyed your blog, will share it with my friends, do you have any other material on this subject?

  4. Peter Jarvis

    There seems to another issue with the plus one script. If you put it after the Googles own analytics code, it stops the javascript from sending any analytics data. Switch them around and it sorts it.

    Testy testy.

Leave a Reply