Google Translate API automatically refreshes the page

2.1k views Asked by At

I have HTML page which has one iframe, some JavaScript code for changing text color, text size all. I have added a Google Translator using the below code

<code>    
      <script type="text/javascript">
        function googleTranslateElementInit() {
            new google.translate.TranslateElement({
                pageLanguage: 'en', includedLanguages: 'en,',
                layout: google.translate.TranslateElement.InlineLayout.SIMPLE, autoDisplay: false
            }, 'google_translate_element');
        }       
    </script>
    <script type="text/javascript" src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
</code>

To display Google Translator on the web page

<code>
      <div id="google_translate_element" style="float:right"></div>
</code>

My problem is my page give a call back to Google Translator every 30 sec that makes page to refresh

I analyzed that only by opening website and keep it open without click on any link it will then also give a call back to

(https://translate.googleapis.com/translate_a/l?client=ab&alpha=true&hl=en&cb=_callbacks____0254asdd) , element_main.js and main.js

I cannot understand how to stop it these callbacks.

1

There are 1 answers

0
C J On

It was my mistake in meta tag have added refresh=30 that is why this issue was occurring

Thank you.............