Some knowledge of JS operation IFrame
1. Print iframe
eg. Framename.document.execcommand (' print ');
2. Get IFRAME
eg. var Ifr_window = window.frames["FrameName"];
3. Get the elements in the IFRAME
Eg1. Place the element with ID ElementID in the IFRAME as not displayed:
var Ifr_window = window.frames["FrameName"];
Ifr_window.elementid.style.display = ' None ';
EG2. Get the table with ID listtable in the IFRAME
Take a look at the example of JS iframe operation
<iframe src= "1.htm" name= "Ifrmname" id= "Ifrmid" ></iframe>
Scenario One: Use the name attribute of the IFRAME to locate
<input type= "button" name= "button" value= "button"
onclick= "Document.frames (' Ifrmname '). Location.reload ()" >
Or
<input type= "button" name= "button" value= "button"
Onclick= "Document.all.ifrmname.document.location.reload ()" >
Scenario Two: Using the id attribute of the IFRAME to locate
<input type= "button" name= "button" value= "button"
Onclick= "Ifrmid.window.location.reload ()" >
Ultimate solution: When iframe src is another Web site address (cross-domain operation)
<input type= "button" name= "button" value= "button"
onclick= "window.open (document.all.ifrmname.src, ' ifrmname ', ')" >
Look at the parent window page
<script type= "text/web Effects" >
function say () {
Alert ("parent.html------>i ' m at Parent.html");
}
function Callchild ()
{
Document.frames ("MyFrame"). F1 ();
Myframe.window.say ();
}
</script>
<body>
<input Type=button value= "invoke functions in Child.html say ()" onclick= "Callchild ()" >
<iframe name= "MyFrame" src= "child.html" ></iframe>
</body>