Hello.

I've installed @Anywhere on a couple of sites and it seems to work fine on Firefox, but it doesn't on Opera. Debug messages show that the JavaScript from http://twitter.com/javascripts/i18n/ru.js is not loaded (because there is no such script at that location). It appears that @Anywhere gets page language from lang parameter and then tries to load corresponding translation. And when it finds that the file is missing, Opera can't just live with that and stops @Anywhere script so it doesn't work. BTW, Firefox also tries and fails to load that file, but it still can work without it. And changing default site language to English fixes the problem for Opera.

You can check out the issue at http://demo.graker.ru

This isn't actually a bug in the module, because I tried to turn on @Anywhere manually (in page templates, in node body) and the problem was always the same. But I think this may be important for other module users.

Comments

graker’s picture

For now I figured two workarounds.

1. I can edit page.tpl.php and manually change html tag lang attribute to be "ru-RU" instead of "ru". Not very comfortable but works anyway. But I actually don't know very much about lang usage. Maybe it's bad to change it this way?

2. I can add $("html").attr("lang","en"); right before @Anywhere initialization, it works too. It may be good since both browser and search bots already had correct lang attribute before scripts were running. And I can restore correct lang attribute after hovercards() by calling $("html").attr("lang","ru"); inside anywhere() function. Then the final code would look just like that:

$("html").attr("lang","en");
twttr.anywhere(function(twitter) {
  twitter.hovercards();
  $("html").attr("lang","ru");
});

So I guess it fixes the issue. Maybe you can insert something like that into the module?

abraham’s picture

Which version of Opera are you using? I did a quick check and didn't see the issue but I may just need dig deeper.

graker’s picture

Version 10.10, build 4742, on Linux.

It appears that Opera just don't like JS errors very much. Since I found this issue, I've noticed many complaints from other JS developers about Opera kills javascripts instantly if there are errors, even minor ones. So I think it's rather Opera's issue than the module's or @Anywhere API's.

BTW
I did a quick check and didn't see the issue but I may just need dig deeper.
If you mean quick check on demo url I gave, it contains correctly working version right now (I applied the solution there). If it's needed, I can restore the original module so you could check out the issue again. Should I?