具體的一個例子——使用IFrame這個框架的一個頁面的代碼如下:
<!-- saved from url=(0014)about:internet -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script src="AC_OETags.js" language="javascript"></script>
<style>
body { margin: 0px; overflow:hidden }
</style>
<script>
<!--
function moveIFrame(x,y,w,h) {
// alert("move to " + x + "," + y + ", " + w + "/" + h);
var frameRef=document.getElementById("myFrame");
frameRef.style.left=x;
frameRef.style.top=y;
frameRef.width=w;
frameRef.height=h;
}
function hideIFrame(){
// alert("hide");
document.getElementById("myFrame").style.visibility="hidden";
}
function showIFrame(){
// alert("show");
document.getElementById("myFrame").style.visibility="visible";
}
function navigateTo(url) {
// alert("nav to " + url);
// alert("from " + document.getElementById("myFrame").location);
document.getElementById("myFrame").src = url;
}
-->
</script>
<script language="VBScript">
<!--
// Catch FS Commands in IE, and pass them to the corresponding JavaScript function.
Sub flexapp_FSCommand(ByVal command, ByVal str)
call flexapp_DoFSCommand(command, str)
end sub
// -->
</script>
</head>
<body style="margin:0px">
<object onMouseDown="document.body.focus();"
classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'
codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,14
,0'
width='100%' height='100%'
id='flexapp' name='flexapp'>
<param name='flashvars' value=''>
<param name='src' value='EXPIframe.swf'>
<param name="wmode" value="opaque">
<embed pluginspage='http://www.macromedia.com/go/getflashplayer' width='100%'
height='100%'
flashvars=''
src='EXPIframe.swf'
name='flexapp'
wmode="opaque"
swLiveConnect="true"
/>
</object>
<iframe id="myFrame" name="myFrame"
frameborder="0"
style="position:absolute;background-
color:transparent;border:0px;visibility:hidden;"></iframe>
</body>
</html>