Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

231
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!