网页另存为txt文件全是乱码,100分送上
------index.htm-------
<html>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
function printview()
{
document.all.test.value="员落入我的视线,破译他的密码而且在bbs上面要容易多了。而且,那个captionTom肯定不会是专业人员。呵呵,他肯定有倏忽的时候";
url="test.htm";
openwin(url);
}
function openwin(url)
{
window.open(url,"chil","status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=700,height=400,top=70,left=50")
}
// -->
</SCRIPT>
</HEAD>
<body>
<INPUT NAME="test" VALUE="">
<INPUT TYPE=button onClick="printview()" VALUE=" test ">
</body>
</html>
------test.htm-------
<html>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
function load()
{
var htmlstr="<html>\n<head>\n<title>正式文件</title>\n<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>\n</head>\n<body bgcolor='#FFFFFF' text='#000000'>";
htmlstr += window.opener.document.all.test.value;
htmlstr +="</body>\n</html>";
document.write(htmlstr)
}
// -->
</SCRIPT>
</HEAD>
<body bgcolor="menu" onload="load();" >
</body>
</html>
通过点击index.htm的“openPage”,打开test.htm页面,在test.htm页中"另存为".text文件时,另存的text文件全是乱码
大家帮忙看看怎样办好呢....