我有一个简单的弹出窗口(没有任何内容),它将加载'onclick'事件。如何修改以下代码以使页面加载时弹出窗口的显示方式相同?在页面加载时显示JavaScript PopUp
<head>
<title>Popup box</title>
<script type="text/javascript">
<!--
function showPopUpBox(id) {
var e = document.getElementById(id);
if(e.style.display == 'block')
e.style.display = 'none';
else
e.style.display = 'block';
}
//-->
</script>
</head>
<body>
<div id="popupBoxPosition">
<div class="popupBoxWrapper">
<div class="popupBoxContent">
<h3>Popup Box</h3>
<p>Form will be held here</p>
<p>Click <a href="javascript:void(0)" onclick="showPopUpBox('popupBoxPosition');">here</a> to close popup box</p>
</div>
</div>
</div>
<div id="wrapper">
<p>Click <a href="javascript:void(0)" onclick="showPopUpBox('popupBoxPosition');">here</a> to see popup box</p>
</div><!-- wrapper end -->
</body>
呼叫在'$函数(的document.ready(函数(){...}))' – Teemu