<script type="text/javascript">
function CreateFile(xml) {
var fso, tf;
//这是在IE7以前的版本中
//支持-通过ActiveXObject的一个新实例来创建XMLHttpRequest对象
fso = new ActiveXObject("Scripting.FileSystemObject");
tf = fso.CreateTextFile("D:\\Downloads\\mxgraph-master\\javascript\\examples\\xmlData\\helloworld.xml", true); //创建一个文件夹
// 写一行,并且带有新行字符。
tf.WriteLine(xml);
// 向文件写三个新行字符。
tf.WriteBlankLines(3);
// 写一行。
// tf.Write("This is a test.");
tf.Close(); //关闭
}
</script>