--------------- 输出和后退
<script language="javascript">
alert("错误~~ 请输入帐号!!");
location.href="javascript:history.back()"
</script>
--------------- 输出并重定向
<script language="javascript">
alert("添加成功~~!!");
location.href="BookList.asp"
</script>
---------------- 内嵌一个页面并设置为可编辑
<script language="javascript">
document.write ('<iframe src="text.asp" id="message" width="550" height="250"></iframe>')
frames.message.document.designMode = "On";
</script>
--------------- 检验复选框是否已选并提示
<script language="javascript">
function checkdata()
{
if (document.form1.viewhtml.checked == true)
{
alert("对不起,请取消“查看HTML源代码”后再添加!")
document.form1.viewhtml.focus()
return false
}
}
</script>
---------------- 用JavaScript 在超连接中打开一个新窗口(可控制大小)
<a href=# onClick="javascript:window.open('Buy.asp?id=<% = rs("Id") %>','','width=570,height=160,toolbar=no, status=no, menubar=no, resizable=yes, scrollbars=yes');return false;">打开一个窗口</a>