Firefox works fine, but on EI8 i'm unable to see the translation buttons and get this "Error on page":


Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322)
Timestamp: Sun, 28 Jun 2009 19:28:20 UTC

Message: Invalid argument.
Line: 6
Char: 5
Code: 0
URI: http://example.com/sites/all/modules/translatablecomments/jquery.transla...

Comments

asak’s picture

Solved by swapping the lines that set the "var"'s - crazy IE... ;/

vako’s picture

I am having the same problem. I see that var link = $("<a />") is causing the problem, but can't figure out how to correct the issue. Please indicate how to solve the issue with the Vars.

thanks!

vako’s picture

Can anyone let me know how we can resolve this issue please.

asak’s picture

Well, the .js file now looks like this, and it works:

if (Drupal.jsEnabled) {
  $(document).ready(function() {
    var wrapper = $("<span></span>").css({ float:"right" });
    var l = $("<a />").attr("href", "#");
    var languages = ["ja", "en"];
  
    $(".comment .content").each(function (i) {    
      var w = $(wrapper).clone().insertBefore(this);
      
      jQuery.each(languages, function(x){
        w.append(l.clone().html(languages[x]).click(function () {
          var n = $(this).parent().next();
          google.language.translate(n.html(), "", languages[x], function(result) {
            if (!result.error) {
              n.html(result.translation);
            } 
	    else {
	      alert(result.error.message);
	    }
          });
          this.blur();
          return false;
        }));
      });
    });
  });
}

(the changes to "var languages" have nothing to do with this fix - it's just the way we needed it setup, so ignore that)

asak’s picture

Status: Active » Needs review

Not sure what should be the status here - i think "needs review" is adequate ...

vako’s picture

Thanks for the code, but it didn't make any change for me. Still I can't see the option in IE and getting the same error:

Message: Invalid argument.
Line: 7
Char: 5
Code: 0
URI: http://www.website.com/sites/all/modules/translatablecomments/jquery.translatablecomments.js?X
davidtrainer’s picture

Status: Needs review » Needs work

So this change does not resolve the issue? Need some help since I don't have a way to test on ie8 at the moment.

vako’s picture

David, what type of help do you need? if you let us know the steps you need, I'll do my best and post the results.