单击弹出按钮后,我想在网页上显示一些文本。但不工作,有什么建议吗?
我不是 javascript 专家,但我正在学习。
<html>
<head>
<script type="text/javascript">
var showMessage = "";
window.onload = function(){
if (confirm("Your Details have been Saved.")) {
showMessage = "Please wait .. going to viewProfile";
window.location.assign("viewProfile.php");
} else {
showMessage = "Please wait ..";
window.location.assign("editProfile.php");
}
}
</script>
</head>
<body id="save-profile-page">
<script type="text/javascript">
document.writeln(showMessage);
</script>
</body>
</html>
由于某种原因,消息不显示,请帮助。