parent.document.getElementById("rightFrame").noResize=true } function enableResize() { parent.document.getElementById("leftFrame").noResize=false parent.document.getElementById("rightFrame").noResize=false } </script> </head>
<body bgcolor="#EFE7D6"> <form> <input type="button" onclick="disableResize()" value="No resize"> <input type="button" onclick="enableResize()" value="Resize"> </form> <p>Try to resize the frame.</p> <p>Right-click inside the two frames and select "View Source" to see the source code.</p> </body>
<body bgcolor="#EFE7D6"> <form> <input type="button" onclick="newSrc()" value="Change frame source"> </form> <p>Right-click inside the two frames and select "View Source" to see the source code.</p> </body>
</html>
跳出框架
<html> <head> <script type="text/javascript"> function breakout() { if (window.top!=window.self) { window.top.location="tryjs_breakout.htm" } } </script> </head>
<body> <form> Click the button to break out of the frame: <input type="button" onclick="breakout()" value="Break out!">