页面中iframe中嵌入一个跨域的页面,让这个页面按照嵌入的页面宽高大小显示的方式;iframe嵌套的页面不可以编辑的问题解决方案

时间:2023-11-26 18:33:02
<html>
	<head>
		<style>
			body {
				margin-left: 0px;
				margin-top: 0px;
				margin-right: 0px;
				margin-bottom: 0px;
				overflow: hidden;
			}
		</style>
	</head>
	<body>
		<iframe src="http://gongkai.kaipuyun.cn/databaseInfo/index" width='100%' height='100%' frameborder='0' name="_blank " id="_blank "></iframe>
	</body>
</html>

效果图:

页面中iframe中嵌入一个跨域的页面,让这个页面按照嵌入的页面宽高大小显示的方式;iframe嵌套的页面不可以编辑的问题解决方案

当发现一个iframe嵌套的页面不可以编辑的时候,解决办法是:

<html>
<head>

</head>
<body>
<iframe src=""001.htm"" id=""SendMsg""  width=""100%"" height=""120px"" ></iframe>
<script>
  document.getElementById(""SendMsg"").contentWindow.document.body.contentEditable= "true";
 </script>
</body>
</html>