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

131
Vistas
Dynamically change URL through event listener

I have an web app that is basically a wiki. When the content is being shown in a parent window there is a menu bar that I am rendering through server-side code.

What I want to do is sometimes use an IFRAME for this content... but when content is generated in the IFRAME I don't want the menu bar to be generated.

I have been adding a simple "&frame=true" parameter to the URL when initially targeting the IFRAME .src (my server-side code reads this param and doesn't generated the menu bar), but my problem is that when navigating hyperlinks within the IFRAME that this "&frame=true" param is lost obviously... and subsequent pages will have the menu bar again.

What I would like to do is to intercept the hyperlink click (let's assume it's all my domain) using an event handler, and if the parent is the IFRAME, add the "&frame=true" parameter to the URL and then fire the hyperlink and page load normally.

I could dynamically regex the of HTML of pages being shown in the IFRAME and add "&frame=true" to ensure subsequent hyperlink clicks don't generate this menu... but looking for a more elegant and less computational approach.

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