Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

130
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda