With Service Links 6.x-2.x-dev, the Google Plus One widget does not render in IE 8. Is anybody else having the same problem?

Comments

orange peel’s picture

I'm also having this issue. Any ideas??

eodonnell’s picture

Me too

leahmd’s picture

Same issue for me, maybe it's related to the same issue as AddThis have with this widget?
http://vp2-www.addthis.com/forum/viewtopic.php?f=5&t=32871&view=next

TheCrow’s picture

leahmd’s picture

I've got this working in IE8.

I found a javascript error in IE8 through the Developer Tools.
"no relay set (used as window.postmessage targetorigin), cannot send cross-domain message"

I googled for that and found a hint that it could be related to xhtml templates, my doc type is xhtml strict and someone suggested that the alternate code be used, using div tags instead of the g tag.

http://code.google.com/apis/+1button/#plusonetag

I swapped out the alternate code with the namespace tags in the module google_plus_one.js

if (Drupal.jsEnabled) {
  $(document).ready(function(){
    $('a.service-links-google-plus-one').each(function(){
      var counter = Drupal.settings.ws_gpo.counter ? '' : 'data-count="false" ';
      var type = (Drupal.settings.ws_gpo.type == '') ? '' : 'data-size="'+ Drupal.settings.ws_gpo.type + '" ';
      var g_text = '<div class="g-plusone" ' + counter + type + 'href="' + $(this).attr('href') + '" >' + '</div>';
      $(this).replaceWith(g_text);
    });
  });
}

Flushed the caches and the button appeared on reload in IE8.

Hope that helps.

TheCrow’s picture

Status: Active » Needs review

on chromium and firefox it shows always 0, maybe something like that is better:

if (Drupal.jsEnabled) {
  $(document).ready(function(){
    $('a.service-links-google-plus-one').each(function(){
      if (navigator.appName == "Microsoft Internet Explorer") {
        var counter = Drupal.settings.ws_gpo.counter ? '' : 'data-count="false" ';
        var type = (Drupal.settings.ws_gpo.type == '') ? '' : 'data-size="'+ Drupal.settings.ws_gpo.type + '" ';
        var g_text = '<div class="g-plusone" ' + counter + type + 'href="' + $(this).attr('href') + '" >' + '</div>';
     }
     else {
       var counter = Drupal.settings.ws_gpo.counter ? '' : 'count="false" ';
       var type = (Drupal.settings.ws_gpo.type == '') ? '' : 'size="'+ Drupal.settings.ws_gpo.type + '" ';
       var g_text = '<g:plusone ' + counter + type + 'href="' + $(this).attr('href') + '" >' + '</g:plusone>';
     }
     $(this).replaceWith(g_text);
    });
  });
}

[Edit] Also this last show always 0 on IE8

TheCrow’s picture

Status: Needs review » Closed (won't fix)

This is a Google trouble.

akosipax’s picture

Hey, I'm not sure how this could be a Google trouble when there are other sites out there that has a Google+ widget and I opened them in IE8 (eg, relevantmagazine.com) I know they use Joomla, so is the problem a combination of Google + IE8 + Drupal? Thanks.

TheCrow’s picture

this website use a not XHTML code... mine is added through Javascript and it cause problems to IE8, maybe in the 3.x i will add the feature to choice what kind of code print...

klaasvw’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev
Status: Closed (won't fix) » Needs review
StatusFileSize
new975 bytes

Here's a patch against the latest version that adds IE8 support for the google plus one button.

The problem is dat jQuery cannot handle the 'g:' in the tag name. The fix uses document.createElement instead.

XmhO’s picture

#10 patch worked for me. I had a "ForEach" error in IE8.

roborn’s picture

Status: Needs review » Reviewed & tested by the community

#10 is working ok here :)
RTBC

simon georges’s picture

Just closed #1431722: Googleplus i8 and below support as a duplicate of this one.

TheCrow’s picture

Status: Reviewed & tested by the community » Fixed

Pushed #10

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.