Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

159
Vistas
The image is loading correctly, but it fails to change when using javascript function
<img id="myImg" src="https://drive.google.com/uc?export=view&amp;id=1gsRqRNoKabIkK9z1NhioUhpFOgIKww5Q" width="107" height="98">

<button onclick="change_image()">Change Image</button>
<script>
function change_image() {
  document.getElementById("myImg").src = "https://drive.google.com/uc?export=view&amp;id=1gsRqRNoKabIkK9z1NhioUhpFOgIKww5Q";
}
</script>

Image from the same link is loading properly. But it fails to change when using a js function

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

&amp; is how you represent a & character in HTML.

It isn't how you represent one in JavaScript (not even JS in a <script> element in an HTML document as <script> elements are defined so that normal HTML parsing rules (where & would switch to the character reference state) are suspended).

The URL is getting a 400 error.

In the JS use only & without the amp;.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda