谁会用javascript+FSO将xml数据写入?
<html><head>
<title>添加个人信息</title>
</head>
<body>
<script language="javascript">
function checkit()
{
var zhangqi=true;
if(document.form1.t1.value=="")
{
window.alert("请将内容填写完整!");
zhangqi=false;
}
else if(document.form1.t2.value=="")
{
window.alert("请将内容填写完整!");
zhangqi=false;
}
else if(document.form1.t3.value=="")
{
window.alert("请将内容填写完整!");
zhangqi=false;
}
else if(document.form1.t4.value=="")
{
window.alert("请将内容填写完整!");
zhangqi=false;
}
else
{
var doc = new ActiveXObject("Msxml2.DOMDocument.3.0");
doc.async=false;
doc.load("zhangqi.xml");
var a=doc.documentElement;
var node=doc.createNode(1,"person","");
a.appendChild(node);
var num=doc.documentElement.childNodes.length;
var b=doc.documentElement.childNodes[num-1];
var node1=doc.createNode(1,"name","");
var node2=doc.createNode(1,"tel","");
var node3=doc.createNode(1,"email","");
var node4=doc.createNode(1,"address","");
node1.text=document.form1.t1.value;
node2.text=document.form1.t2.value;
node3.text=document.form1.t3.value;
node4.text=document.form1.t4.value;
b.appendChild(node1);
b.appendChild(node2);
b.appendChild(node3);
b.appendChild(node4);
window.alert(doc.documentElement.xml);
var fso = new ActiveXObject("Scripting.FileSystemObjcet");
var textfile=fso.createTextFile("F:\我的程序\XML\XML练习\zhangqi.xml");
textfile.writeLine(doc.documentElement.xml);
textfile.close();
}
return zhangqi;
}
</script>
<%
if request("hid")="ok" then
response.redirect("zhangqi.xml")
else
%>
<center>
<br><br><br><br>
<font color="red" size=4><b> 填写个人信息</b></font><br><br>
<form action="add.asp" method="post" name=form1>
<input type=hidden name=hid value="ok">
姓 名: <input type=text name=t1 size=20><br><br>
电 话: <input type=text name=t2 size=20><br><br>
Email: <input type=text name=t3 size=20><br><br>
地 址: <input type=text name=t4 size=20><br><br><br>
<input type=submit name=sub1 value=" 添 加 " onclick="return checkit()">
<input type=reset name=reset1 value=" 重 填 ">
</form>
</center>
<%
end if
%>
</body>
</html>
----------------------------------------------------------------------------------------------------------------------------------------
var fso = new ActiveXObject("Scripting.FileSystemObjcet");
var textfile=fso.createTextFile("F:\我的程序\XML\XML练习\zhangqi.xml");
textfile.writeLine(doc.documentElement.xml);
textfile.close();
运行下来就这段不行,别的都没问题
xml文件写不进去,不知道哪里错了