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

142
Vistas
Modal behaviour -how can I change this code to pull in dynamic content and improve page speed?

I've taken over a site build that has modals hard coded into the template. All is good apart from these modals which are causing slow page speed results - I think because each modal is loading in an iFrame from a platform that seems to have slow loading forms and extra scripts etc.

I'm looking for a way to tweak the code that is there currently so that it loads in the modal content dynamically rather than it just being on every page and hidden by CSS. I'm not really a coder, but I'm pretty sure that this is a very clumsy way of doing it and can be streamlined significantly!

I've extracted the relevant code and put it here:

https://codepen.io/Patz/pen/oNwPJve

<div id="cta-contactus" class="modal">
    
    <div class="modal-content">
        <span class="close">&times;</span>
        <!--[if lte IE 8]>
        <script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2-legacy.js"></script>
        <![endif]-->
        <script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/v2.js"></script>
    </div>
</div>

Perhaps these forms could be embedded in external iFrames so that they are not on the page by default, but I think this could also not be the best way of achieving this! Any tips much appreciated :)

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