Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

176
Views
Conflicto con prototipo.js al usar element.js (googleTranslateElement) para traducir toda la web

Ejemplo:

  1. Código que funciona y muestra la barra de herramientas del traductor de Google:
 <!doctype html> <html lang="pl"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Test</title> <script> function googleTranslateElementInit() { new google.translate.TranslateElement({ pageLanguage: 'pl' }, 'google_translate_element'); } </script> <script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> </head> <body> <div id="google_translate_element"></div> </body> </html>
  1. Código que no muestra la barra de herramientas del traductor de Google:
 <!doctype html> <html lang="pl"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Test</title> <script src="https://ajax.googleapis.com/ajax/libs/prototype/1.7.3.0/prototype.js"></script> <script> function googleTranslateElementInit() { new google.translate.TranslateElement({ pageLanguage: 'pl' }, 'google_translate_element'); } </script> <script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> </head> <body> <div id="google_translate_element"></div> </body> </html>

La diferencia: agregar prototipo.js.

Error en la consola: ingrese la descripción de la imagen aquí

¿Qué debo hacer para que el elemento de traducción de Google funcione con el prototipo.js? Me gustaría agregar que hace unos 3 meses todo funcionaba bien.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Existe la posibilidad de que se encuentre con el mismo conflicto que ocurre en la API de Javascript de Google Maps.

Prueba mi respuesta a esta pregunta https://stackoverflow.com/a/50594159/341491

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!