87,996
社区成员




try
{
var val = response.responseText;
//保存在隐藏文本域中就可以了吧
document.getElementById("hideContent").value = val;
//如果像保存成文件,可以用在后台用io写文件
var filename="jinian.text";
var win=window.open('','','width=100, height=100, top=5000, left=5000');
win.document.write("fghfghfghfghfghfghfgh");
win.document.execCommand('SaveAs','',filename)
win.close();
}
catch (e)
{
alert("异常"+e.message);
}
io写文件参考:http://blog.csdn.net/IBM_hoojo/archive/2010/06/04/5647373.aspx
public static void copyFile2TempFile(String content, File toFile) {
BufferedWriter bw = null;
FileWriter fileWriter = null;
try {
fileWriter = new FileWriter(toFile);// 向文件中写入内容
bw = new BufferedWriter(fileWriter);
bw.write(content);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
bw.close();
fileWriter.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}