Links In HTML iFrame Won't Open In Parent Window - html

I have an iframe in HTML, but the links from the iframe open within the iframe. I tried adding target="_parent", but the hyperlicks still open within the iFrame.
<iframe src="misc.php?page=UnitedStatesMap" target="_parent" frameborder="0"></iframe>
I am really new to StackOverFlow, and HTML in general. So this is probably a really dumb question. Sorry, but I just can't figure this out.
Thanks for your help.

The target needs to go in the head of the HTML page within the iframe. IE the iframe page should have:
<head>
<base target="_blank">
</head>
See here for more.
If you want a link on your page to open in the iFrame you would do something like:
<iframe src="demo_iframe.htm" name="iframe_a"></iframe>
<p>W3Schools.com</p>
As far as I know I don't think it's possible to control where links open just through the iFrame attributes.

Related

embed youtube video not working for some video like vevo

I have a problem with this code:
<!DOCTYPE html>
<html>
<body>
<embed width="420" height="315"
src="https://www.youtube.com/v/_Yhyp-_hX2s">
</body>
</html>
it work on "try it yourself" on w3school.com but not work in my page, neither in a blank html page. I have this problem only with some video like vevo
There is actually nothing wrong with you code!
As soon as you host it it'll work. If you're on Linux try to copy the html file to "/var/www/html/" and in your browser type: "localhost/yourfilename.html". It should work!
(You'll need something like apache running).
Embed tag sometimes making problems on bbc and youtube. Try iframe tag.
see also

How to use iframe tag for display width and height

<!DOCTYPE html>
<html>
<body>
<iframe src="https://desk.zoho.com/portal/myclassboard/kb/articles/how-to-view-event-details-in-the-calendar/">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
Hi friends,
I need how to use the iframe. the above code i wrote display the website in a iframe, but in some cases it work properly and some cases its not working properly, when i change the website link.
In the above case we have change the link to some https://corp6beta.myclassboard.com/ its working but while put the above link its not working.
I am new to iframe please help me... how to avoid the problem.
I've encountered same question like this before,this might help you iFrame not Loading.

iFrame not Loading some URL's but loading others

So, I'm confused pretty severely... So I went to w3Schools iFrame page. Copy and pasted this code into codepen directly from w3schools...
<iframe src="https://www.w3schools.com"></iframe>
I also tried changing the URL a few times. Loading Google even didn't work... All that happens is a blank page with the same background color as the parent page. I dont understand why the iframe code even from w3schools doesn't work... Am i not loading a dependency? I'm using the latest version of chrome.
index.html
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Soundcloud Downloader</title>
</head>
<body>
<div class="container">
<iframe src="http://1stdibs.com/"></iframe>
<iframe src="http://soundtake.net/"></iframe>
<iframe src="https://www.w3schools.com"></iframe>
</div>
</body>
</html>
A working code pen:
https://codepen.io/anon/pen/GEePEK
My view (screenshot):
http://imgur.com/a/6bPWB
Check this one
Checking if a website doesn't permit iframe embed and this one too Certain websites won't appear with Iframe and .load() function.
I had same problem few year back then i came through these,some sites avoid iframe tag.

Iframe does not show the page

putting this is the html webpage does not show the page, what is the reason?
<!DOCTYPE html>
<html>
<body>
<iframe src="https://secure.mom.gov.sg/iSubmit/Pages/default.aspx">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
Here's what I look, I am using chrome v25.
The main problem is page should have some information when it's beeing display in iframe. Because it's go throught https site it's probably don't so you can display it in iframe.
More info in second post:
http://www.dotnetnuke.com/Resources/Forums/forumid/39/threadid/240336/scope/posts.aspx
I think there is a problem with redirection in https:// site. Your src site doesn't rate iframe as a trustworthy platform. Generally, iframes shouldn't be used for whole pages like that.

Can I have doctype in iframe different from hosting page

Can I have doctype in iframe different from hosting page or iframe necessarily inherits doctype from hosting page?
<!DOCTYPE 1>
<html>
<body>
<iframe>
<!DOCTYPE 2>
</iframe>
</body>
</html>
Yes, you can have a different doctype in the page that loads in the iframe.
The page containing the iframe and the page loading in the iframe are completely separate. The page in the iframe doesn't inherit anything at all from the page containing the iframe.
You can do this. No problem (for example flash ads).