jQuery を使用して XML ファイルに書き込みたいと思います。次のことを前提とします。
app.writeXML = function(data) {
$.get("xml/sample.xml", function(resp) {
var node = $(resp).find("Sample")
$(node).append('<test>this is a test</test>')
//write to the sample.xml file with the additional "test" node added
}, 'xml')
}
新しいノード「test」は、ローカル メモリ内の「Sample」ノードの最後に追加されていますか、それともエラーですか?
ローカル メモリのみにある場合は、実際にファイルに書き込むにはサーバー側のコンポーネントが必要だと思います。PHP を使用すると、これはどのように見えるでしょうか。