Search Engines & iFrame - html

I have a very basic html, supposingly
<html>
<body>
<iframe src="http://www.google.com">
<p>Your browser does not support iframes.</p>
</iframe>
</body>
</html>
When I render the page with Google/Yahoo as a source address there is no display. This is what I see in firebug
<iframe src="http://www.google.com">
<html>
<head></head>
<body></body>
</html>
</iframe>
If I am doing something wrong please correct else please provide any authentic documentation if search englines have blocked iframes. Would really appreciate.
p.s You can try the above example on W3Schools too.

You cannot bypass it in browsers , they will simply refuse to display websites in iframe that send a
X-Frame-Options header with DENY or SAMEORIGIN . It doesn't even come down to javascript.
For more read on ClickJacking and X-Frame-Options

what google says about iframe, read Here
refer to Avoid iFrames - or link to their content separately...

With javascript you can easily find out if your site is displayed inside a frameset/IFrame or if it is stands alone:
<script type="text/javascript">if(self!=top){/*I am framed*/}</script>
Probably Google has this code in one of its scripts, and when it finds out that its site is inside a foreign frame, it deletes its content.
With the same simple trick a html page can break out of every frame:
<script type="text/javascript">
if(self!=top){
top.location.replace(self.location.href);
}
</script>
If you want to try out this break-free-trick, replace in your code www.google.com with the url of my site: wissen.schoelnast.at (it is in German)

Related

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.

Mobile links in an Iframe and IOS

I was trying today to open a mobile link from one of my webapp that runs in an iframe (same domain).
It looks like these links aren't recognized by apple ?
https://plnkr.co/edit/9Rp87NcVi9Kr4MGDgIwL?p=preview
Body file
<html>
<body>
1-888-888-1212
<iframe src="iframe.html"></iframe>
</body>
</html>
iframe.html
<body>
1-877-877-2323
</body>
In the following plunkr i made a little example of that.
My Local computer can recognize those links, both, and so does my multiple android devices. Although when it comes to IOS, nothing to be done about it, it will only work for the link that is not in an Iframe.
Anybody had a simillar problem and or knows a solution to this issue ?
By using a script to select the parent document from the iframe, it should work. try this:
edit Adding "target="_parent" to the anchor is the solution for those viewing this answer.
Dated answer:
<iframe id="test" src="iframe.html"></iframe>
<script>
var iframe = document.getElementById("test");
var iDoc = iframe.contentDocument;
iDoc.write('<a target="_parent" href="tel://1-888-888-1212">1-888-888-1212</a>');
</script>

Access anchor tag attribute inside iframe

Parent domain: www.parent.com
Iframe domain: www.iframe.com
<html>
<head></head>
<body>
<iframe id="trick" src="www.iframe.com/test">
<html>
<head></head>
<body>
test
</body>
</html>
</body>
</html>
Question: how to access the value of href of anchor tag inside iframe using jquery?
Since they pages appear on different origins:
The page containing the frame needs to listen for a Message event.
The page inside the frame needs to send a message using postMessage.
This, obviously, requires changes on both sites. Explicit co-operation between the sites is required for obvious security reasons (if they aren't obvious, imagine your bank's website being loaded in an iframe by a random site you visited via Google).
Check this link: http://simple.procoding.net/2008/03/21/how-to-access-iframe-in-jquery/
$('#iframeID').contents().find('#someID').html();

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.

Html - how to actually work with local iframes? (Nothing shows up)

I am doing some work that would require me building up html inside of embedded iframes. Sort of like jsbin does.
However I'm stumped with my very first spike.
How come my html isn't being rendered when I put it inside an iframe?
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body>
<iframe>
<html>
<head><meta charset=utf-8 /></head>
<body>
<h1>Big Header</h1>
</body>
</html>
</iframe>
</body>
</html>
Here's my jsbin.
Additionally when I tried drawing some svgs inside the iframe with d3 they came out looking all weird and not scaling. After opening dev tools and editing the svg text as html I found that even adding a non-meaningful space anywhere would get it to redraw and render correctly. So bonus points if anyone can tell me any resources I can read up on cause clearly iframes don't work like I thought.
iframes need to be pointed at a page to load. you don't put html between iframe tags. if you put anything between iframe tags - it is text you want to display in the case the browser the client is using doesn't support the tag. you should make the html above its own local html page, and point the iframe src attribute above to point at that web page.
After a day of research:
Like Mike said, html inside an iframe is for the case the browser does not support iframes and will not show up otherwise. However, it IS absolutely possible to construct a document inside an iframe on the fly and without a server-side query. To do this, you have to use javascript to construct the document. You can get a reference to it and write html like so:
var iframe = document.getElementsByTagName('iframe')[0];
,doc = iframe.contentDocument || iframe.contentWindow.document
;
doc.open();
doc.write('<p>Some html</p>');
do.close();
Note that as Remy mentions here the document must be opened before writing and closed after.