Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use the nested iframe in html?

Tags:

html

I am trying like this.But frame1 is visible. I can't show the frame2. The code is below,

    <!DOCTYPE html>
<html>
<body>

<iframe src="http://www.w3schools.com" width="1000" height="1000" id="frame1" name="frame1">
  <iframe width="200" height="200" src="http://www.bing.com" id="frame2" name="frame2">
  </iframe></iframe></body></html>

Can any one please help me.

like image 623
Balakumar Avatar asked Feb 22 '13 07:02

Balakumar


Video Answer


2 Answers

The child elements of an iframe are alternative content for use if frames are disabled or not supported.

Either make the child frame a sibling or move it to the document you load into the outside frame.

like image 163
Quentin Avatar answered Sep 23 '22 03:09

Quentin


If you want an iframe inside of and iframe you should do the following:

The link to access this page should have ?interframe=true at the end of it.
e.g. http://www.example.com/test.html?interframe=true
You shouldn't add ?interframe=true to the ends of http://www.w3schools.com and http://www.bing.com though.

To make it clear:
Let's say your homepage is http://www.example.com And the page that you need help with is http://www.example.com/test

The <a> tag in http://www.example.com that brings you to http://www.example.com/test.html should be <a href="http://www.example.com/test.html?interframe=true">example text</a>

I hope this helps.

like image 42
Charlie Avatar answered Sep 19 '22 03:09

Charlie