IE8 error in jquery.translatablecomments.js

asak - June 28, 2009 - 19:37
Project:Translatable Comments
Version:6.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work
Description

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...

#1

asak - July 5, 2009 - 20:28

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

#2

Vako - July 27, 2009 - 00:39

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!

#3

Vako - July 28, 2009 - 16:44

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

#4

asak - July 29, 2009 - 06:08

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)

#5

asak - July 29, 2009 - 06:09
Status:active» needs review

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

#6

Vako - July 29, 2009 - 15:53

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

#7

davidtrainer - November 12, 2009 - 23:14
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.

 
 

Drupal is a registered trademark of Dries Buytaert.