<!-- lang: html -->
<html>
<!-- lang: html -->
<head>
<!-- lang: html -->
<script type="text/javascript">
<!-- lang: html -->
function show_popup(){
<!-- lang: html -->
var p = window.createPopup()
<!-- lang: html -->
var pbody=p.document.body
<!-- lang: html -->
pbody.style.backgroundColor="green"
<!-- lang: html -->
pbody.style.border="solid black 1px"
<!-- lang: html -->
pbody.innerHTML="这是一个pop-up!在pop-up外面点击它,即可关闭它"
<!-- lang: html -->
p.show(150,150,200,50,document.body)
<!-- lang: html -->
}
<!-- lang: html -->
</script>
<!-- lang: html -->
</head>
<!-- lang: html -->
<body>
<!-- lang: html -->
<button onclick="show_popup()">显示pop-up</button>
<!-- lang: html -->
</body>
<!-- lang: html -->
</html>
效果: