求救 关于保存为文本文件
阿古 2003-07-21 10:25:26 看我的这个函数
调用此函数时可以将网页上的某些数据保存为文本文件.
但是保存下来以后,文本文件中是乱码(如果保存为HTM格式不会出错).
谁能帮我解决????????????
function saveas()
{
//文本文件会出现乱码在中文下.
var winSave = window.open();
winSave.document.open ("text/html","GB2312");
winSave.document.write ("测试文件");
winSave.document.execCommand ('SaveAs',true,'会议考勤数据.txt','.txt');
//winSave.document.execCommand ('SaveAs',true,'会议考勤数据','.htm'); 这个不会出现乱码.
winSave.close();
}
</script>