javascript - Javascript write to local XML file
问题描述
I know there are several questions how to save changes in an XML file using Javascript, and the obvious answer is: use a server side language such as PHP.
In my case, the XML file is in the same directory as my html file locally on my computer, not on any server.
In my index.html I access the alphabets.xml
this way:
function getAlphabets() {
var xhttp;var result;
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
result = findAlphabets(this);
console.log(result);
}
};
xhttp.open("GET", "alphabets.xml", true);
xhttp.send();
}
I want to change some data in the xml file, and save it back there. Is there any possible way to do so in plain javascript?
Or another way, not using a server side language?
解决方案
推荐阅读
- struts2 - 在struts select标签中显示对象数组List(Object [])的列表
- javascript - 如何在 Javascript 中的消息正文中添加按钮?
- javascript - 将 css 和 js 与 HTML 文件链接时遇到问题
- javascript - back4app | 网站中可见的 APPLICATION ID 的安全性如何
- javascript - 单击 JQuery 中的链接时,var 并不总是设置
- c# - 仅获取具有 TransitiveMembers Microsoft Graph C# SDK 的用户
- python - 分数的意外结果
- flutter - 步进器的内容不滚动
- python-3.x - 尽管采购了pythonpath,但由于找不到模块错误而无法运行python文件
- python - Django 2 form is_valid 即使在有效的表单数据上也不起作用