最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Google Translate Not working in Any IE but works in Firefox and GoogleChrome - Stack Overflow

programmeradmin2浏览0评论

I have tested this page in IE, Firefox, and Google Chrome. It works in all except IE. Can someone please tell me how to fix this, I have tried just about everything I could for the last two days.

TRY THIS TEST PAGE

<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>

<body>
Hello
<div id="google_translate_element"></div>
        <script type="text/javascript">
        function googleTranslateElementInit() {
                new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');
            }
        </script>
        <script type="text/javascript" src=".js?cb=googleTranslateElementInit"></script>
</body>
</html>

When selecting a language it shows the choice picked but never pletes the translation.. But works in FireFox and Google Chrome. IE just sits at 0% and just keeps spinning. Is anyone else experiencing the same issue?

The error it throws in the console when switching languages is this:

XMLHttpRequest: Network Error 0x2f1c, Could not plete the operation due to error 00002f1c.

I have tried many things even going as far as something like this:

<div id="google_translate_element"></div>
        <script type="text/javascript">
        $.ajax({
  url:".js?cb=googleTranslateElementInit",
  type:"POST",
  data:"google_translate_element",
  contentType:"application/json; charset=utf-8",
  dataType:"json",
  success: function googleTranslateElementInit() {
                new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');
            }

  })
        </script>

Please any help would be greatly appreciated!!

I have tested this page in IE, Firefox, and Google Chrome. It works in all except IE. Can someone please tell me how to fix this, I have tried just about everything I could for the last two days.

TRY THIS TEST PAGE

<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>

<body>
Hello
<div id="google_translate_element"></div>
        <script type="text/javascript">
        function googleTranslateElementInit() {
                new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');
            }
        </script>
        <script type="text/javascript" src="http://translate.google./translate_a/element.js?cb=googleTranslateElementInit"></script>
</body>
</html>

When selecting a language it shows the choice picked but never pletes the translation.. But works in FireFox and Google Chrome. IE just sits at 0% and just keeps spinning. Is anyone else experiencing the same issue?

The error it throws in the console when switching languages is this:

XMLHttpRequest: Network Error 0x2f1c, Could not plete the operation due to error 00002f1c.

I have tried many things even going as far as something like this:

<div id="google_translate_element"></div>
        <script type="text/javascript">
        $.ajax({
  url:"http://translate.google./translate_a/element.js?cb=googleTranslateElementInit",
  type:"POST",
  data:"google_translate_element",
  contentType:"application/json; charset=utf-8",
  dataType:"json",
  success: function googleTranslateElementInit() {
                new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');
            }

  })
        </script>

Please any help would be greatly appreciated!!

Share Improve this question edited Jun 17, 2015 at 20:57 Zane Z asked Jun 17, 2015 at 13:55 Zane ZZane Z 2331 gold badge2 silver badges11 bronze badges 2
  • The issue was raised on our forums as well and it seems that it will work in IE11 privacy mode. So yes, asking your users to hit Ctrl+Shift+P to access the website isn't a good solution but it's a workaround meanwhile. See colnect./en/forum/viewtopic!f=46&t=56363&p=152435 – Collector Commented Jul 2, 2015 at 0:08
  • is there any solution we have for this problem of IE? – vim Commented Apr 12, 2021 at 14:46
Add a ment  | 

8 Answers 8

Reset to default 2

In the code there is a link to the google translate file

//translate.google....

When I put the full address into my browser it automatically downloaded a text file. I converted the .txt file into to a .js file then replaced the web link with a link to the js file and it worked fine. I hope this helps.

I have finally found the issue!! The new security update broke the translator. If you delete KB3058515 this will fix the problem. But now we have to figure out how to make it work with the update since users will not delete there security updates.

I would ment if i had enough rep.

I have the same issue, works fine on Chrome and Firefox but it just fails on IE.

An alternative is the Microsoft Bing translator http://www.microsoft./translator/getstarted.aspx.

If anyone could help us that would be appreciated

I have the same issue, I think this is more a case of having MS not following the same rules that Mozilla and Google do to achieve the same results. This is really an IE issue that they should resolve, They are one of three that are trying to protect users from the method by which http can strip https security. One example was given where a user logs in to his bank using http which then redirects to https giving someone access to redirect the user to a false bank account to gather his details. I am still laughing at the very idea that a bank would use http transport anyway. Banks should use secure connections for everything. But it doesn't solve our problem. I have advised my clients to use Firefox or Chrome until this matter is resolved, which is outside my ability.

I had the same issue and found some other discussions. It is related to the introduction of support for HTTP Strict Transport Security standard (HSTS) in IE11, included in security update KB 3058515.

It looks like your options are:

  • get users to remove or disable KB 3058515
  • get Google to add their sites to Microsoft's HSTS preload list
  • get Google to enable HSTS through use of the Strict-Transport-Security HTTP header
  • (possibly) get your site added to Microsoft's HSTS preload list

More discussion here: http://answers.microsoft./en-us/ie/forum/ie11-windows_7/google-translate-widget-not-working-in-internet/55f835e2-6460-46f3-8e71-9dbf3c3f5e49

Microsoft KB article: https://support.microsoft./en-us/kb/3071338

This issue is tied to a June 2015 update of Internet Explorer. By downloading the July 2015 release: Version 11.0.9600.17914, Update Versions 11.0.21 (KB3065822) - the issue seems to have been resolved. Microsoft is aware of the issue as noted in their forums. I believe they addressed it with a fix in the July release.

A remended fix for user might be to have them update their browsers, if auto update is not turned on.

I recently hit this issue on a website. Translator showed up normally in Firefox, Chrome and on mobile browsers, but nothing in IE 8-11. Our solution was a pretty simple fix (which I imagine will not be the care for most). We literally just had to flip the script link and the script function.

<script src="//translate.google./translate_a/element.js?cb=googleTranslateElementInit"></script>
<script>
  function googleTranslateElementInit() {
    new google.translate.TranslateElement(
        {pageLanguage: 'en'},
        'google_translate'
    );

    jQuery('.goog-logo-link').css('display', 'none');
    jQuery('.goog-te-gadget').css('font-size', '0');
  }
</script>

Became:

<script>
  function googleTranslateElementInit() {
    new google.translate.TranslateElement(
        {pageLanguage: 'en'},
        'google_translate'
    );

    jQuery('.goog-logo-link').css('display', 'none');
    jQuery('.goog-te-gadget').css('font-size', '0');
  }
</script>
<script src="//translate.google./translate_a/element.js?cb=googleTranslateElementInit"></script>

This fixed the issue of not displaying in IE, but also didn't hurt Chrome or Firefox.

I'd also ment if I had enough rep.

I have the same issue as well. For me, it started after IE updated to v.11.0.9600.17843 (update version 11.0.20). Google Translate widget was working fine in IE before that.

发布评论

评论列表(0)

  1. 暂无评论