现在的位置: 首页 > 综合 > 正文

js获取iframe框架中src所指向的文件的內容 .

2013年12月12日 ⁄ 综合 ⁄ 共 659字 ⁄ 字号 评论关闭

 

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>获取iframe框架中src所指向的文件的內容</title>
</head>
<script language=javascript>
function ini(){
 alert(document.getElementById("frame_id").contentWindow.document.body.innerHTML)

</script>
<body onload="ini()">
<iframe id=frame_id src="test.asp"></iframe>

</body>

</html>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>获取iframe框架中src所指向的文件的內容</title>
</head>
<script language=javascript>
function ini(){
 alert(document.getElementById("frame_id").contentWindow.document.body.innerHTML)

</script>
<body onload="ini()">
<iframe id=frame_id src="test.asp"></iframe>

</body>

</html>

抱歉!评论已关闭.