<html>
<body>
<p id="p1">Hello World!</p>
<script id="myScript" src="/demo/demo_async.js" async></script>
<p>点击按钮检测是否异步执行脚本(一旦脚本可用)。</p>
<p id="demo"></p>
<button onclick="myFunction()">尝试一下</button>
<script>
function myFunction()
{
var x = document.getElementById("myScript").async;
document.getElementById("demo").innerHTML = x;
};
</script>
</body>
</html>