Download & Extend

IE8 error in jquery.translatablecomments.js

Project:Translatable Comments
Version:6.x-1.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs work

Issue Summary

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

#1

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

#2

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

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

#4

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

Status:active» needs review

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

#6

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

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.

#8

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.

nobody click here