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

750
Views
JS: no se pudo ejecutar 'getComputedStyle' en 'Ventana': el parámetro no es del tipo 'Elemento'

En resumen: estoy tratando de entender el significado de este TypeError: no se pudo ejecutar 'getComputedStyle' en 'Window': el parámetro 1 no es del tipo 'Elemento' El error aparece mientras se abre el VisualEditor de Mediawiki, como se puede ver aquí:

http://www.wiki.org.il/index.php?title=new-page&veaction=edit

El error no permite crear nuevas páginas o editar la wiki de forma anónima. Sin embargo, con el uso de una máscara diferente, el error desaparece:

http://www.wiki.org.il/index.php/Main_Page?useskin=vector

El wiki se ejecuta en 1.25alpha.

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Tuve este mismo error mostrando. Cuando reemplacé el selector jQuery con JavaScript normal, se solucionó el error.

 var this_id = $(this).attr('id');

Reemplazar:

 getComputedStyle( $('#'+this_id)[0], "")

Con:

 getComputedStyle( document.getElementById(this_id), "")
over 4 years ago · Santiago Trujillo Report

0

El mensaje de error dice que getComputedStyle requiere que el parámetro sea del tipo Element . Lo recibe porque el parámetro tiene un tipo incorrecto.

El caso más común es que intentas pasar un elemento que no existe como argumento:

 my_element = document.querySelector(#non_existing_id);

Ahora que el elemento es null , esto dará como resultado el error mencionado:

 my_style = window.getComputedStyle(my_element);

Si no es posible obtener siempre el elemento correctamente, puede, por ejemplo, usar lo siguiente para finalizar la función si querySelector no encontró ninguna coincidencia:

 if (my_element === null) return;
over 4 years ago · Santiago Trujillo Report

0

Para aquellos que recibieron este error en AngularJS y no en jQuery:

Lo obtuve en AngularJS v1.5.8 al intentar ng-include un type="text/ng-template" que no existía.

 <div ng-include="tab.content">...</div>

Asegúrese de que cuando use ng-include, los datos para esa directiva apunten a una página/sección real. De lo contrario, probablemente querías:

 <div>{{tab.content}}</div>
over 4 years ago · Santiago Trujillo 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!