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

92
Views
¿Puedo definir "documento" como una variable en Javascript?

En mi aplicación, a veces quiero definir "documento" para usar en querySelector como "tinymce.get('steps_html').contentAreaContainer.childNodes[0].contentWindow.document". Otras veces, quiero que "documento" tenga su significado habitual.

¿Hay alguna manera de configurar "documento" para que sea una variable? He intentado lo siguiente, ninguno de los cuales devuelve un elemento:

Definición de documento:

 document = tinymce.get('steps_html').contentAreaContainer.childNodes[0].contentWindow.document; document.querySelector(myElement) // Returns nothing

Definición de un prefijo:

 prefix = tinymce.get('steps_html').contentAreaContainer.childNodes[0].contentWindow; prefix.document.querySelector(myElement); //Returns nothing

Definición de un prefijo como texto:

 prefix = "tinymce.get('steps_html').contentAreaContainer.childNodes[0].contentWindow; prefix.document.querySelector(myElement)"; //Returns nothing

Solo tinymce.get('steps_html').contentAreaContainer.childNodes[0].contentWindow.document.querySelector(myElement) devuelve un elemento.

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

0

Encontré mi propia respuesta. Lo publicaré en caso de que alguien más se encuentre con esta publicación.

Primero, encuentre su iframe de TinyMCE Editor

 var iframe = document.querySelector("#myDiv .tox-editor-container .tox-edit-area iframe");

Luego obtén su contenido

 var iframe_content = iframe.contentDocument;

Luego puedes realizar tus consultas

 var frame_li = iframe_content.querySelectorAll("#tinymce li");
about 4 years ago · Juan Pablo Isaza Report

0

¿Has probado window.orig_document = window.document window.document = tinymce.get('steps_html').contentAreaContainer.childNodes[0].contentWindow.document window.document = window.document.orig_document

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!