Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: having trouble with links in an iframe |
|
Author |
|
Doug22
Joined: 02 Jun 2013 Posts: 57 Location: Houston TX
|
Posted: Wed 03 Apr '24 14:30 Post subject: having trouble with links in an iframe |
|
|
I have a home page, and in at the bottom of that home page, I have an iframe with another web page. That other web page has many URL links. Somewhat strangely, when I'm on that home page, and I click on a link in the iframe, it doesn't go there! I have to right click on it and "Open Link in New Tab" in order to open that link. I have to assume that since the iframe doesn't own the home page, it is reluctant to replace it.
How do I make it so that when I click on a link in an iframe, it just GOES THERE?
I should add that when both home page and iframe are local, everything works fine. It's when they are online that I have the problem. |
|
Back to top |
|
Doug22
Joined: 02 Jun 2013 Posts: 57 Location: Houston TX
|
Posted: Wed 03 Apr '24 23:08 Post subject: fixed |
|
|
OK, fixed.
Need to put <base target="_parent"> in the <head> block of the page in the iframe.
Boy, that was easy! |
|
Back to top |
|
Stray78
Joined: 15 Apr 2024 Posts: 22 Location: USA
|
Posted: Sun 23 Jun '24 21:19 Post subject: |
|
|
I do not use iframes anymore, is there a specific reason you use them still?
Anyways you could use <a href="" target="_blank">link here</a>
target="_blank" is for opening in a new page/tab. |
|
Back to top |
|
|
|
|
|
|