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

230
Vistas
Can I make an Iframe open up the links in a new tab?

I am working on adding a news section to my website and would like for the section to show the top stories from a news site. The best way to do this I found would be with an IFrame (not sure if this is best way to do what I am wanting to do). I have created the script to make the IFrame show what I am wanting it to show, but the news story gets opened within the border created. I am wanting to make it so that if they click the news story they go to the article directly, or make it so that if it is clicked the article is opened bigger on the main site, so that it can actually be read.

This is the script I am currently working with.

KKTV TOP HEADLINES

<iframe src="https://www.kktv.com" style="border: 0px none; margin-left: 2px; height: 960px; margin-top: -520px; width: 800px;">

Any help with figuring out how to accomplish my goal or other ideas to create what I am wanting to create is greatly appreciated. My main goal is to create a block for my website that shows this news websites top stories that people can then click on and read (either on my website or redirected directly to the articles site).

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

This question should contain your answer.

"You can't (or it is extremely hard to ) make events inside the iframe affect the parent page. This is to prevent attacks from XSS, or cross site scripting. Having said that, if the site within the iframe is on your own domain and you want to set up some extremely tricky ajaxing and php session IDs, maybe you could make something work, but even then I'm not sure. And I don't know if this would be a security hole, maybe someone else can speak to that. It would perhaps look like:

  1. main page sets up session ID and passes that to the iframe url via a get variable

  2. the iframe takes click information and sends it to a Session variable via an ajaxing call to a script on the server.

  3. The main page then reads (how?) the session cookie and makes changes based on it's value.

All in all, you may find that it may be much simpler and more secure to achieve what you want using a different method."

about 4 years ago · Juan Pablo Isaza Denunciar

0

it open the url as pop-up but google chrome block it ... good luck on what you're doing i guess

 <script> window.open("https://www.kktv.com","_blank"); </script>
about 4 years ago · Juan Pablo Isaza Denunciar
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