3
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","t1.txt",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseText;
xmlhttp.open("w","t1.txt");
xmlhttp.writeln('hai');
xmlhttp.close();
console.log(xmlDoc);
我會讀取使用XMLHttpRequest()
t1.txt文件,我怎麼會寫在同一個文件中一些文字t1.txt
見http://stackoverflow.com/questions/30563157/edit-save-self-modifying-html-document-format-generated-下載新文件html-javascript – guest271314