源代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>编程字典</title> </head> <body> <iframe src="demo_iframe_sandbox.html" sandbox> <p>你的浏览器不支持iframe.</p> </iframe> <p>The "Get date and time" button will run a script in the inline frame.</p> <p>Since the sandbox attribute is set, the content of the inline frame is not allowed to run scripts.</p> <p>You can add "allow-scripts" to the sandbox attribute, to allow the JavaScript to run.</p> <p><strong>Note:</strong> The sandbox attribute is not supported in Internet Explorer 9 and earlier versions, or in Opera 12 and earlier.</p> </body> </html>
运行结果