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

232
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
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