案例:html/html5 案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html>
2
<html>
3
<body>
4
5
<iframe src="/example/html/demo_iframe_sandbox.html" sandbox="">
6
  <p>Your browser does not support iframes.</p>
7
</iframe>
8
9
<p>"获得日期和时间" 按钮会在行内框架中运行一段脚本。</p>
10
<p>由于 sandbox 属性被设置为空字符串 (""),行内框架的内容不允许运行脚本。</p>
11
<p>如果向 sandbox 属性添加 "allow-scripts",则允许运行 JavaScript。</p>
12
<p><b>注释:</b>IE 9 以及更早的版本不支持 sandbox 属性,Opera 12 以及更早的版本也不支持该属性。</p>
13
14
</body>
15
</html>