The iframe height is set to the height of the subpage
//You need to use Jquery
$(document).ready(function () {
parent.document.getElementById("ifPage").style.height = document.body.scrollHeight "px";
});
iframe is highly adaptive to the parent page
//You need to use Jquery
$(window).resize(function () {
var webheight = document.body.clientHeight - X; //X is the height that needs to be subtracted, such as the height of the top navigation
$("#ifPage").attr("style", "height:" webheight "px;");
});
$(window).load(function () {
var webheight = document.body.clientHeight - 105;
$("#ifPage").attr("style", "height:" webheight "px;");
});
Transfer elements between parent and child pages
The parent page gets the data in the child page, JS code:
//Get the object according to the id of the iframe
var i1 = window.frames['iframeId'];
//var iframe =window.frames[0] ;You can also
//Get the element value in the iframe
var val=i1.document.getElementById("t1").value
The child page gets the data in the parent page, JS code:
var val = parent.document.getElementById( "txt1");
Transfer between subpages, JS code:
var i1 = parent.window.frames['iframeId'];
var val = i1.document.getElementById("text1").value;
Refresh the parent page
function parentReload( ) { window.parent.location.reload();}
Reload subpage
iframe.Attributes[ "Src"] = "ItemTQEditorPage.aspx";