javascript 对话框 如何修改标题?

JavaScript011

javascript 对话框 如何修改标题?,第1张

用showModalDialog()弹出对话框。

例子如下:

1、A.html:执行弹出对话框

<script>

showModalDialog("B.html","","dialogWidth:250pxdialogHeight:200pxcenter:yeshelp:noresizable:yesstatus:no")

</script>

2、B.html:弹出对话框需要显示的内容

<html>

<title>弹出对话框标题</title>

<body>

<p>对话框内容</p>

</body>

</html>

JS中alert样式为浏览器内置设定,标题及颜色等是无法修改的。

如果因为网站的需要,需要修改标题或者样式等,一般解决方案是使用DOM模拟弹出