how to save xml files using Javascript?

后端 未结 1 1011
一生所求
一生所求 2021-01-02 22:35

I tried to

1) load an xml file using javascript as an object, say note.xml

2) then save the object to a new xml file, sa

相关标签:
1条回答
  • 2021-01-02 22:48

    Your problem is: javaScript does not have an input/output (I/O) API as it is a client-side scripting language and consequently has no access to the file system via the server. You would need to use a server-side scripting language to save data to a server. There may be hacks to solve your problem client-side, but they are probably either unsave or otherwise buggy. (btw: what api is the save method member of? Did you make that up?)

    What you can do is save data temporarily to any DOM element (e.g. window, or a javaScript) object. There is however no way to make these changes permanent.

    In your case, looking in to PHP scripting might be the best way to go.

    0 讨论(0)
提交回复
热议问题