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

248
Vistas
En el HTML <H2>, el texto no aparece en la vista previa de impresión del navegador Google Chrome

Estoy usando código JavaScript para generar una vista previa de impresión de clic de evento, luego en la vista previa de impresión no puedo obtener el texto <H2> , mientras que el texto <h1> aparece en la salida html5 en Google Chrome pero el texto <H2> no aparece en la impresión vista previa del navegador Chrome, guíeme y sugiérame

¡Gracias por adelantado!

Aporte:

 <?xml version="1.0" encoding="UTF-8"?> <pat> <title>Main Title is Here</title> <body> <section> <title>section title is here</title> <p>Content is here</p> </section> <section><title>section title is here</title> <p>content is here</p> </section> </body> </pat>

Código JavaScript:

 function contentWindowPrint(){ var getiframeurl = document.getElementById('contentwin'); if(location) { if(location.protocol == "file:") { printIframe(getiframeurl.src, window.iframeHeight.height); } else{ getiframeurl.contentWindow.window.print() } } } function printIframe(url, height) { var heading_one = window.iframeHeight.heading var proxyIframe = document.createElement('iframe'); var body = document.getElementsByTagName('body')[0]; body.appendChild(proxyIframe); proxyIframe.style.width = '100%'; proxyIframe.style.height = '100%'; proxyIframe.style.display = 'none'; var contentWindow = proxyIframe.contentWindow; contentWindow.document.open(); var is_chrome = Boolean(contentWindow.chrome); contentWindow.document.write("<h2>" + heading_one +"</h2>") contentWindow.document.write('<iframe src="' + url + '" onload="print();" width="1450" height="' + (height + 700) + '" frameborder="0" marginheight="0" marginwidth="0"></iframe>'); contentWindow.document.close(); // necessary for IE >= 10 and necessary before onload for chrome if (is_chrome) { contentWindow.onload = function() { // wait until all resources loaded }; } else { contentWindow.document.write('<iframe src="' + url + '" onload="print();" width="1450" height="' + (height + 700) + '" frameborder="0" marginheight="0" marginwidth="0"></iframe>'); contentWindow.document.close(); // necessary for IE >= 10 and necessary before onload for chrome } return true; } $(document).ready(function() { $("div.ditasearch > input").val('') $("div.ditasearchHeader > input").val('') });
about 4 years ago · Juan Pablo Isaza
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