<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<script>
function window.onbeforeunload()
{
if(document.forms[0].t.value!="initvalue...")
{
if(confirm("你已经输入了资料,是否保存?"))
{
document.forms[0].submit();
}
}
}
</script><body>
<form action=save.asp>
<textarea id=t>initvalue..</textarea>
</form></body>
</html>
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<script>
function window.onbeforeunload()
{
if(document.forms[0].t.value!="initvalue...")
{
if(confirm("你已经输入了资料,是否保存?"))
{
document.forms[0].submit();
}
}
}
</script><body>
<form action=save.asp>
<textarea id=t>initvalue..</textarea>
</form></body>
</html>
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<script>
function window.onbeforeunload()
{
if(document.forms[0].t.value!="initvalue..")
{
if(confirm("你已经输入了资料,是否保存?"))
{
document.forms[0].submit();
return(!true);
}
}
}
</script><body>
<form action=save.asp>
<textarea id=t>initvalue..</textarea>
</form></body>
</html>不过还是有弹出窗口询问,这点我也解决不了。
function window.onbeforeunload()
{
if(document.forms[0].t.value!="initvalue..")
{
if(confirm("你已经输入了资料,是否保存?"))
{
document.forms[0].submit();
//return(!true);
}
}
}
</script><body>
<form action="save.asp" target="_blank">
<textarea id=t>initvalue..</textarea>
</form>